/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
export class APIError extends Error {
    constructor(message, rawResponse, body = "") {
        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;
        this.name = "APIError";
    }
}
//# sourceMappingURL=apierror.js.map