From 6caae555ee347be8d99a3f3c6e1d479499339e9a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:28:44 +0000 Subject: [PATCH] feat(client): make request-id header more accessible (#462) --- src/error.ts | 3 +++ 1 file changed, 3 insertions(+) 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; }