MCPcopy
hub / github.com/serverless/examples / createErrorResponse

Function createErrorResponse

aws-node-rest-api-mongodb/handler.js:10–14  ·  view source on GitHub ↗
(statusCode, message)

Source from the content-addressed store, hash-verified

8const mongoString = ''; // MongoDB Url
9
10const createErrorResponse = (statusCode, message) => ({
11 statusCode: statusCode || 501,
12 headers: { 'Content-Type': 'text/plain' },
13 body: message || 'Incorrect id',
14});
15
16const dbExecute = (db, fn) => db.then(fn).finally(() => db.close());
17

Callers 1

handler.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected