ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.557.0

This commit is contained in:
speakeasybot
2025-06-09 00:13:46 +00:00
parent 2b38478255
commit a7ec77cd04
281 changed files with 11113 additions and 10513 deletions

View File

@@ -2,41 +2,33 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
export class SDKError extends Error {
/**
* HTTP status code
*/
public readonly statusCode: number;
/**
* HTTP content type
*/
public readonly contentType: string;
/**
* HTTP body
*/
public readonly body: string;
/**
* Raw response
*/
public readonly rawResponse: Response;
import { PlexAPIError } from "./plexapierror.js";
/** The fallback error class if no more specific error class is matched */
export class SDKError extends PlexAPIError {
constructor(
message: string,
rawResponse: Response,
body: string = "",
httpMeta: {
response: Response;
request: Request;
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.body = body;
this.rawResponse = rawResponse;
this.statusCode = statusCode;
this.contentType = contentType;
if (message) {
message += `: `;
}
message += `Status ${httpMeta.response.status}`;
const contentType = httpMeta.response.headers.get("content-type") || `""`;
if (contentType !== "application/json") {
message += ` Content-Type ${
contentType.includes(" ") ? `"${contentType}"` : contentType
}`;
}
const body = httpMeta.body || `""`;
message += body.length > 100 ? "\n" : " ";
message += `Body ${body}`;
message = message.trim();
super(message, httpMeta);
this.name = "SDKError";
}
}