MCPcopy Create free account
hub / github.com/defunctzombie/node-enchilada / sendError

Function sendError

index.js:228–235  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

226 }
227
228 function sendError(err) {
229 if (typeof next === 'function') {
230 return next(err);
231 }
232
233 res.setHeader('Content-Type', 'text/plain');
234 respond(500, err.toString());
235 }
236
237 function respond(code, data) {
238 data = new Buffer(data);

Callers 1

sendResponseFunction · 0.85

Calls 1

respondFunction · 0.85

Tested by

no test coverage detected