MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / errorSchemaFactory

Function errorSchemaFactory

packages/baseai/src/dev/hono/errors.ts:25–44  ·  view source on GitHub ↗
(code: z.ZodEnum<any>)

Source from the content-addressed store, hash-verified

23]);
24
25export function errorSchemaFactory(code: z.ZodEnum<any>) {
26 return z.object({
27 error: z.object({
28 code: code.openapi({
29 description: 'A machine readable error code.',
30 example: code._def.values.at(0)
31 }),
32 docs: z.string().openapi({
33 description:
34 'A link to our documentation with more details about this error code',
35 example: `https://langbase.com/docs/api-reference/errors/${code._def.values
36 .at(0)
37 .toLowerCase()}`
38 }),
39 message: z.string().openapi({
40 description: 'A human readable explanation of what went wrong'
41 })
42 })
43 });
44}
45
46export const ErrorSchema = z.object({
47 success: z.literal(false).openapi({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected