Function parse_error_response

Source
pub async fn parse_error_response<R>(
    response: Response,
) -> Result<R, OpenAIError>
Expand description

Attempts to parse the OpenAI error body. If successful, returns Err(OpenAIError::APIError). Otherwise, returns a generic error based on the HTTP status code or raw text.