ResponsesApiException Class

Definition

Exception that wraps a fully-formed Error model and an HTTP status code. Thrown when code needs to surface a structured API error that serializes directly to ApiErrorResponse. Maps to the specified StatusCode.

public class ResponsesApiException : Exception
type ResponsesApiException = class
    inherit Exception
Public Class ResponsesApiException
Inherits Exception
Inheritance
ResponsesApiException

Constructors

Name Description
ResponsesApiException(Error, Int32, Exception)

Initializes a new instance of ResponsesApiException with an Error model, HTTP status code, and inner exception.

ResponsesApiException(Error, Int32)

Initializes a new instance of ResponsesApiException with an Error model and HTTP status code.

Properties

Name Description
Error

Gets the structured error model to serialize in the API response body.

StatusCode

Gets the HTTP status code to return.

Applies to