MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / constructor

Method constructor

apps/api/src/lib/errors/api-error.ts:10–23  ·  view source on GitHub ↗
(
    code: ErrorCode,
    message: string,
    statusCode = 500,
    fieldErrors?: Record<string, string>,
    details?: Record<string, unknown>
  )

Source from the content-addressed store, hash-verified

8 public readonly details: Record<string, unknown> | undefined;
9
10 constructor(
11 code: ErrorCode,
12 message: string,
13 statusCode = 500,
14 fieldErrors?: Record<string, string>,
15 details?: Record<string, unknown>
16 ) {
17 super(message);
18 this.name = "ApiError";
19 this.code = code;
20 this.statusCode = statusCode;
21 this.fieldErrors = fieldErrors;
22 this.details = details;
23 }
24
25 toResponse(): IApiErrorResponse {
26 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected