mirror of https://gitee.com/bigwinds/arangodb
nicer error messages
This commit is contained in:
parent
627e377a70
commit
8ec82daba0
|
@ -12,6 +12,7 @@ JAVASCRIPT_JSLINT = \
|
|||
@srcdir@/html/admin/js/arangodb/browser.js \
|
||||
@srcdir@/js/actions/system/api-collection.js \
|
||||
@srcdir@/js/actions/system/api-structure.js \
|
||||
@srcdir@/js/actions/system/api-system.js \
|
||||
@srcdir@/js/client/modules/org/arangodb.js \
|
||||
@srcdir@/js/client/modules/org/arangodb/deploy.js \
|
||||
@srcdir@/js/common/bootstrap/errors.js \
|
||||
|
|
|
@ -102,7 +102,9 @@ function Routing (req, res) {
|
|||
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);
|
||||
var msg = 'A runtime error occurred while executing an action: ' + String(err) + " " + String(err.stack);
|
||||
|
||||
actions.errorFunction(action.route, msg)(req, res, action.route.callback.options, next);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1396,6 +1396,14 @@ function resultException (req, res, err, headers) {
|
|||
var msg = err.errorMessage;
|
||||
var code = exports.HTTP_BAD;
|
||||
|
||||
if (num === 0) {
|
||||
num = arangodb.ERROR_INTERNAL;
|
||||
}
|
||||
|
||||
if (msg === "") {
|
||||
msg = String(err) + " " + String(err.stack);
|
||||
}
|
||||
|
||||
switch (num) {
|
||||
case arangodb.ERROR_INTERNAL: code = exports.HTTP_SERVER_ERROR; break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue