We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56f4821 commit 8cdd7eaCopy full SHA for 8cdd7ea
src/error.ts
@@ -13,6 +13,8 @@ export class APIError extends OpenAIError {
13
readonly param: string | null | undefined;
14
readonly type: string | undefined;
15
16
+ readonly request_id: string | null | undefined;
17
+
18
constructor(
19
status: number | undefined,
20
error: Object | undefined,
@@ -22,6 +24,7 @@ export class APIError extends OpenAIError {
22
24
super(`${APIError.makeMessage(status, error, message)}`);
23
25
this.status = status;
26
this.headers = headers;
27
+ this.request_id = headers?.['x-request-id'];
28
29
const data = error as Record<string, any>;
30
this.error = data;
0 commit comments