mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-11 04:20:58 +00:00
Normalized imports, regenerated
This commit is contained in:
25
src/sdk/models/errors/sdkerror.ts
Normal file
25
src/sdk/models/errors/sdkerror.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
export class SDKError extends Error {
|
||||
public readonly statusCode: number;
|
||||
public readonly contentType: string;
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly rawResponse: Response,
|
||||
public readonly body: string = ""
|
||||
) {
|
||||
const statusCode = rawResponse.status;
|
||||
const contentType = rawResponse.headers.get("content-type") || "";
|
||||
const bodyString = body.length > 0 ? `\n${body}` : "";
|
||||
|
||||
super(`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`);
|
||||
|
||||
this.statusCode = statusCode;
|
||||
this.contentType = contentType;
|
||||
|
||||
this.name = "SDKError";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user