AI::Provider::APICallError
Inherits AI::Provider::AISDKError < Exception < Reference < Object
Error thrown when an API call fails.
This error captures detailed information about the failed API request including URL, request body, response details, and retry eligibility.
Constructors
new(*, message : String, url : String, request_body_values, status_code : Int32 | Nil = nil, response_headers : Hash(String, String) | Nil = nil, response_body : String | Nil = nil, cause : Exception | Nil = nil, is_retryable : Bool | Nil = nil, data = nil)
Creates a new APICallError.
Parameters:
- message: The error message
- url: The URL that was called
- request_body_values: The request body values (any JSON-serializable type)
- status_code: Optional HTTP status code
- response_headers: Optional response headers
- response_body: Optional response body
- cause: Optional underlying exception
- is_retryable: Whether the request can be retried (auto-computed if not provided)
- data: Optional additional error data
Class methods
Instance methods
request_body_values
The request body values that were sent. Stored as JSON::Any to handle any JSON-serializable type.