mirror of https://gitee.com/bigwinds/arangodb
in case some-one throw a string
This commit is contained in:
parent
7abf112d8c
commit
6c368d70eb
|
@ -325,7 +325,12 @@ module.exports =
|
|||
if (service.isDevelopment) {
|
||||
const err = error.cause || error;
|
||||
body.exception = String(err);
|
||||
body.stacktrace = err.stack.replace(/\n+$/, '').split('\n');
|
||||
|
||||
if (err.stack === undefined) {
|
||||
body.stacktrace = "no stacktrace available";
|
||||
} else {
|
||||
body.stacktrace = err.stack.replace(/\n+$/, '').split('\n');
|
||||
}
|
||||
}
|
||||
if (error.extra) {
|
||||
Object.keys(error.extra).forEach(function (key) {
|
||||
|
|
Loading…
Reference in New Issue