共用方式為


PipelineMessageClassifier.TryClassify Method

Definition

Overloads

TryClassify(PipelineMessage, Boolean)

Attempt to evaluate whether the provided PipelineMessage contains a Response that the client should consider an error response.

TryClassify(PipelineMessage, Exception, Boolean)

Attempt to evaluate whether the provided PipelineMessage contains a Response that indicates the client should retry the Request.

TryClassify(PipelineMessage, Boolean)

Source:
PipelineMessageClassifier.cs
Source:
PipelineMessageClassifier.cs

Attempt to evaluate whether the provided PipelineMessage contains a Response that the client should consider an error response.

public abstract bool TryClassify (System.ClientModel.Primitives.PipelineMessage message, out bool isError);
abstract member TryClassify : System.ClientModel.Primitives.PipelineMessage * bool -> bool
Public MustOverride Function TryClassify (message As PipelineMessage, ByRef isError As Boolean) As Boolean

Parameters

message
PipelineMessage

The PipelineMessage to classify.

isError
Boolean

true if the Response should be considered an error response.

Returns

true if the classifier had an opinion regarding whether the service response was an error response; false otherwise.

Remarks

Not all classifiers derived from PipelineMessageClassifier will classify a given PipelineMessage. Returning false from TryClassify(PipelineMessage, Boolean) allows a classifier instance to compose with other classifiers by passing the classification decision to a later instance. Default will always return true from TryClassify(PipelineMessage, Boolean) and may be used as the last classifier in any composed classifier collection.

Applies to

TryClassify(PipelineMessage, Exception, Boolean)

Source:
PipelineMessageClassifier.cs
Source:
PipelineMessageClassifier.cs

Attempt to evaluate whether the provided PipelineMessage contains a Response that indicates the client should retry the Request.

public abstract bool TryClassify (System.ClientModel.Primitives.PipelineMessage message, Exception? exception, out bool isRetriable);
abstract member TryClassify : System.ClientModel.Primitives.PipelineMessage * Exception * bool -> bool
Public MustOverride Function TryClassify (message As PipelineMessage, exception As Exception, ByRef isRetriable As Boolean) As Boolean

Parameters

message
PipelineMessage

The PipelineMessage to classify.

exception
Exception

An Exception, if any, that will also be used in the retry classification. Callers are intended to provide any exception thrown during the attempt to send the prior request.

isRetriable
Boolean

true if the Request should be retried.

Returns

true if the classifier had an opinion regarding whether the service request should be retried; false otherwise.

Remarks

Not all classifiers derived from PipelineMessageClassifier will classify a given PipelineMessage. Returning false from TryClassify(PipelineMessage, Boolean) allows a classifier instance to compose with other classifiers by passing the classification decision to a later instance. Default will always return true from TryClassify(PipelineMessage, Boolean) and may be used as the last classifier in any composed classifier collection.

Applies to