How to use the InternalError function from restify
Find comprehensive JavaScript restify.InternalError code examples handpicked from public code repositorys.
227 228 229 230 231 232 233 234 235 236
backend.getWorkflows(req.params, function (err, workflows) { if (err) { if (err.toRestError) { return next(err.toRestError); } else { return next(new restify.InternalError(err)); } } res.send(200, workflows); return next();
71
449
0
+ 10 other calls in file
37 38 39 40 41 42 43 44 45 46
milestone: require('../models/milestone'), } const http403 = restify.NotAuthorizedError const http404 = restify.ResourceNotFoundError const http500 = restify.InternalError function createFinder(modelName, gOpts) { return function findModel(opts) { opts = opts || {}
46
0
2
GitHub: misterdjules/sdc-cloudapi
51 52 53 54 55 56 57 58 59
var InvalidArgumentError = restify.InvalidArgumentError; var MissingParameterError = restify.MissingParameterError; var ResourceNotFoundError = restify.ResourceNotFoundError; var InternalError = restify.InternalError; var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; var MAC_RE = /^[0-9a-f]{12}/i;
24
0
1
GitHub: richardkiene/sdc-vmapi
190 191 192 193 194 195 196 197 198 199
err: error, url: req.url, params: req.params }); res.send(new restify.InternalError('Internal Server Error')); }); config.napi.log = log.child({ component: 'napi' }, true); config.cnapi.log = log.child({ component: 'cnapi' }, true);
20
0
1
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616
return new restify.InternalError(err, errMsg); } } samples.InternalError = new restify.InternalError('boom'); //---- exports
17
5
0
+ 5 other calls in file
GitHub: geek/triton-cmon
94 95 96 97 98 99 100 101 102 103
/* * Returns a handler that will log uncaught exceptions properly */ function uncaughtHandler(req, res, route, err) { res.send(new mod_restify.InternalError(err, 'Internal error')); /** * We don't bother logging the `res` here because it always looks like * the following, no added info to the log. *
12
0
2
110 111 112 113 114 115 116 117 118 119
res.send(409, errors); return (false); }; if (!self.ufds_client) { next(new restify.InternalError('Upstream server down')); } else { req.ufds = self.ufds_client; next(); }
8
6
0
59 60 61 62 63 64 65 66 67 68
} return error; } function InternalError(msg , outMsg){ var error = new restify.InternalError(msg); if(outMsg){ error.body.outMsg = outMsg; } return error;
0
0
0
+ 3 other calls in file
restify.createServer is the most popular function in restify (1059 examples)