diff --git a/src/error.ts b/src/error.ts index 7f869677..b49eb8e2 100644 --- a/src/error.ts +++ b/src/error.ts @@ -9,6 +9,8 @@ export class APIError extends AnthropicError { readonly headers: Headers | undefined; readonly error: Object | undefined; + readonly request_id: string | null | undefined; + constructor( status: number | undefined, error: Object | undefined, @@ -18,6 +20,7 @@ export class APIError extends AnthropicError { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; + this.request_id = headers?.['request-id']; this.error = error; }