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

Method toResponse

apps/api/src/lib/errors/api-error.ts:25–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 }
24
25 toResponse(): IApiErrorResponse {
26 return {
27 success: false,
28 error: {
29 code: this.code,
30 message: this.message,
31 ...(this.details !== undefined && { details: this.details }),
32 ...(this.fieldErrors !== undefined && {
33 fieldErrors: this.fieldErrors,
34 }),
35 timestamp: now(),
36 },
37 };
38 }
39}

Callers 2

errorHandlerFunction · 0.80
api-error.test.tsFile · 0.80

Calls 1

nowFunction · 0.90

Tested by

no test coverage detected