<PackageReference Include="Azure.Core" Version="1.44.0" />

ResponseClassificationHandler

public abstract class ResponseClassificationHandler
A type that analyzes an HTTP message and determines if the response it holds should be treated as an error response. A classifier of this type may use information from the request, the response, or other message property to decide whether and how to classify the message.

This type's TryClassify method allows chaining together handlers before applying default classifier logic. If a handler in the chain returns false from TryClassify, the next handler will be tried, and so on. The first handler that returns true will determine whether the response is an error.

public abstract bool TryClassify(HttpMessage message, out bool isError)

Populates the isError out parameter to indicate whether or not to classify the message's response as an error.