-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgalileogeneratederror.ts
More file actions
35 lines (32 loc) · 928 Bytes
/
galileogeneratederror.ts
File metadata and controls
35 lines (32 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
/** The base class for all HTTP error responses */
export class GalileoGeneratedError extends Error {
/** HTTP status code */
public readonly statusCode: number;
/** HTTP body */
public readonly body: string;
/** HTTP headers */
public readonly headers: Headers;
/** HTTP content type */
public readonly contentType: string;
/** Raw response */
public readonly rawResponse: Response;
constructor(
message: string,
httpMeta: {
response: Response;
request: Request;
body: string;
},
) {
super(message);
this.statusCode = httpMeta.response.status;
this.body = httpMeta.body;
this.headers = httpMeta.response.headers;
this.contentType = httpMeta.response.headers.get("content-type") || "";
this.rawResponse = httpMeta.response;
this.name = "GalileoGeneratedError";
}
}