MCPcopy
hub / github.com/dubinc/dub / handleAndReturnErrorResponse

Function handleAndReturnErrorResponse

apps/web/lib/api/errors.ts:147–150  ·  view source on GitHub ↗
(err: unknown, headers?: Headers)

Source from the content-addressed store, hash-verified

145}
146
147export function handleAndReturnErrorResponse(err: unknown, headers?: Headers) {
148 const { error, status } = handleApiError(err);
149 return NextResponse.json<ErrorResponse>({ error }, { headers, status });
150}
151
152export const errorSchemaFactory = (
153 code: z.infer<typeof ErrorCode>,

Callers 15

withPublishableKeyFunction · 0.90
withWorkspaceFunction · 0.90
withSessionFunction · 0.90
withPartnerProfileFunction · 0.90
withReferralsEmbedTokenFunction · 0.90
processOrderFunction · 0.90
GETFunction · 0.90
POSTFunction · 0.90
GETFunction · 0.90
POSTFunction · 0.90
POSTFunction · 0.90
GETFunction · 0.90

Calls 1

handleApiErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…