fromResponse(response: Response): Promise<OpenRouterError>| Name | Type | Description |
|---|---|---|
response* | Response |
Creates a typed error from an HTTP Response.
Attempts to parse the body as JSON (OpenRouter's standard
{ error: { message, code, metadata } } shape). Falls back to the
raw HTTP status text when the body is missing or unparseable.
Status-code mapping: