MCPcopy
hub / github.com/simstudioai/sim / errorResponse

Function errorResponse

apps/sim/app/api/v1/admin/responses.ts:37–52  ·  view source on GitHub ↗
(
  code: string,
  message: string,
  status: number,
  details?: unknown
)

Source from the content-addressed store, hash-verified

35 * Create an error response
36 */
37export function errorResponse(
38 code: string,
39 message: string,
40 status: number,
41 details?: unknown
42): NextResponse<AdminErrorResponse> {
43 const body: AdminErrorResponse = {
44 error: { code, message },
45 }
46
47 if (details !== undefined) {
48 body.error.details = details
49 }
50
51 return NextResponse.json(body, { status })
52}
53
54// =============================================================================
55// Common Error Responses

Callers 6

unauthorizedResponseFunction · 0.70
forbiddenResponseFunction · 0.70
notFoundResponseFunction · 0.70
badRequestResponseFunction · 0.70
internalErrorResponseFunction · 0.70
notConfiguredResponseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected