MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / errorBody

Function errorBody

src/commands/test.wait.spec.ts:76–98  ·  view source on GitHub ↗
(code: string, details: Record<string, unknown> = {})

Source from the content-addressed store, hash-verified

74}
75
76function errorBody(code: string, details: Record<string, unknown> = {}) {
77 const statusMap: Record<string, number> = {
78 AUTH_REQUIRED: 401,
79 AUTH_FORBIDDEN: 403,
80 NOT_FOUND: 404,
81 VALIDATION_ERROR: 400,
82 CONFLICT: 409,
83 RATE_LIMITED: 429,
84 INTERNAL: 500,
85 };
86 return {
87 status: statusMap[code] ?? 400,
88 body: {
89 error: {
90 code,
91 message: `Error: ${code}`,
92 nextAction: 'do something',
93 requestId: 'req_test',
94 details,
95 },
96 },
97 };
98}
99
100const instantSleep = () => Promise.resolve();
101

Callers 1

test.wait.spec.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected