1
0
Fork 0

in case some-one throw a string

This commit is contained in:
Frank Celler 2017-01-13 21:14:14 +01:00
parent 7abf112d8c
commit 6c368d70eb
1 changed files with 6 additions and 1 deletions

View File

@ -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) {