UNPKG

unstructured-client

Version:

<h3 align="center"> <img src="https://raw.githubusercontent.com/Unstructured-IO/unstructured/main/img/unstructured_logo.png" height="200" > </h3>

41 lines 1.37 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export class ServerError extends Error { constructor(err) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; if (err.detail != null) this.detail = err.detail; this.name = "ServerError"; } } /** @internal */ export const ServerError$inboundSchema = z.object({ detail: z.string().optional(), }) .transform((v) => { return new ServerError(v); }); /** @internal */ export const ServerError$outboundSchema = z.instanceof(ServerError) .transform(v => v.data$) .pipe(z.object({ detail: z.string().optional(), })); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var ServerError$; (function (ServerError$) { /** @deprecated use `ServerError$inboundSchema` instead. */ ServerError$.inboundSchema = ServerError$inboundSchema; /** @deprecated use `ServerError$outboundSchema` instead. */ ServerError$.outboundSchema = ServerError$outboundSchema; })(ServerError$ || (ServerError$ = {})); //# sourceMappingURL=servererror.js.map