mirror of https://gitee.com/bigwinds/arangodb
more verbose action debugging
This commit is contained in:
parent
c226af8e0b
commit
2360cb1cee
|
@ -84,7 +84,17 @@ function Routing (req, res) {
|
|||
req.urlParameters = {};
|
||||
}
|
||||
|
||||
action.route.callback.controller(req, res, action.route.callback.options, next);
|
||||
var func = action.route.callback.controller;
|
||||
if (func === null || typeof func !== 'function') {
|
||||
func = actions.errorFunction(action.route, 'Invalid callback definition found for route ' + JSON.stringify(action.route));
|
||||
}
|
||||
|
||||
try {
|
||||
func(req, res, action.route.callback.options, next);
|
||||
}
|
||||
catch (err) {
|
||||
actions.errorFunction(action.route, 'A runtime error occurred while executing an action: ' + String(err))(req, res, action.route.callback.options, next);
|
||||
}
|
||||
}
|
||||
|
||||
next = function () {
|
||||
|
|
|
@ -1445,6 +1445,7 @@ function redirectRequest (req, res, options, next) {
|
|||
exports.defineHttp = defineHttp;
|
||||
exports.getErrorMessage = getErrorMessage;
|
||||
exports.getJsonBody = getJsonBody;
|
||||
exports.errorFunction = errorFunction;
|
||||
exports.reloadRouting = reloadRouting;
|
||||
exports.firstRouting = firstRouting;
|
||||
exports.nextRouting = nextRouting;
|
||||
|
|
Loading…
Reference in New Issue