-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunauthorized-error-error.ts
More file actions
47 lines (41 loc) · 1.21 KB
/
Copy pathunauthorized-error-error.ts
File metadata and controls
47 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v4-mini";
import * as types from "../../types/primitives.js";
import { VerseDbError } from "./verse-db-error.js";
export type UnauthorizedErrorErrorData = {
message: string;
};
export class UnauthorizedErrorError extends VerseDbError {
/** The original data that was passed to this error instance. */
data$: UnauthorizedErrorErrorData;
constructor(
err: UnauthorizedErrorErrorData,
httpMeta: { response: Response; request: Request; body: string },
) {
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
super(message, httpMeta);
this.data$ = err;
this.name = "UnauthorizedErrorError";
}
}
/** @internal */
export const UnauthorizedErrorError$inboundSchema: z.ZodMiniType<
UnauthorizedErrorError,
unknown
> = z.pipe(
z.object({
message: types.string(),
request$: z.custom<Request>(x => x instanceof Request),
response$: z.custom<Response>(x => x instanceof Response),
body$: z.string(),
}),
z.transform((v) => {
return new UnauthorizedErrorError(v, {
request: v.request$,
response: v.response$,
body: v.body$,
});
}),
);