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

Class ApiError

packages/baseai/src/dev/hono/errors.ts:112–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112export class ApiError extends HTTPException {
113 public readonly code: ErrorCodesType;
114 public readonly success: boolean;
115 public readonly rateLimit?: RateLimitErrorResponse;
116 public readonly docs?: string;
117
118 constructor({
119 status,
120 code,
121 message,
122 rateLimit,
123 docs
124 }: {
125 status?: StatusCode;
126 code: ErrorCodesType;
127 message: string;
128 rateLimit?: RateLimitErrorResponse;
129 docs?: string;
130 }) {
131 super(status || codeToStatus(code), { message });
132 this.code = code;
133 this.success = false;
134 this.rateLimit = rateLimit;
135 this.docs = docs;
136 }
137}
138
139export class ApiErrorZod extends HTTPException {
140 public readonly code: ErrorCodesType;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected