Closed gchudnov closed 10 years ago
There were a few reasons:
new Error().stack
in Chrome) that won't deserialize back in useful ways depending on which JS VM is being used.So we decided to go with what seemed the safer route: stick to the spec and don't expose internal server behavior by default, but provided the object escape. Note that it's anything that's not an Error
object, so you could do something like this:
function VisibleError(message, arbitraryProperty, showStack) {
this.message = message;
this.arbitraryProperty = arbitraryProperty;
if (showStack) this.stack = new Error().stack;
}
...
throw new VisibleError('we have a problem, 'arbitrary!', true);
got it, thank you!
Guess, the issue is closed now.
Hello,
It looks the error is overwritten in the response of server.js. Any additional properties set in the Error are lost:
server.js, line 68-:
^^ here only the
message
is copied. We have additional properties set in Error and they are lost.Need to create a plain object instead of using an Error to provide additional properties.
Are there any rationale behind the behavior you implemented or is that a bug?