Skip to content

Commit

Permalink
feat(client): make request-id header more accessible (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jul 29, 2024
1 parent 2295263 commit 6caae55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}

Expand Down

0 comments on commit 6caae55

Please sign in to comment.