UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

44 lines 1.55 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import * as components from "../components/index.js"; import { UnkeyError } from "./unkeyerror.js"; /** * Error response when an unexpected error occurs on the server. This indicates a problem with Unkey's systems rather than your request. * * @remarks * * When you encounter this error: * - The request ID in the response can help Unkey support investigate the issue * - The error is likely temporary and retrying may succeed * - If the error persists, contact Unkey support with the request ID */ export class InternalServerErrorResponse extends UnkeyError { constructor(err, httpMeta) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; this.meta = err.meta; this.error = err.error; this.name = "InternalServerErrorResponse"; } } /** @internal */ export const InternalServerErrorResponse$inboundSchema = z.object({ meta: components.Meta$inboundSchema, error: components.BaseError$inboundSchema, request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new InternalServerErrorResponse(v, { request: v.request$, response: v.response$, body: v.body$, }); }); //# sourceMappingURL=internalservererrorresponse.js.map