Skip to content

Commit 04f1248

Browse files
author
Stefan-Gabriel Muscalu
committed
Update: [Result] Keep only the caller's stack trace, discard the old one
1 parent 87b644e commit 04f1248

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/v1/result.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ class Result {
138138
// notify connection holder that the used connection is not needed any more because error happened
139139
// and result can't bee consumed any further; call the original onError callback after that
140140
self._connectionHolder.releaseConnection().then(() => {
141-
error.stack = error.stack + '\n' + this._stack;
141+
// Error.prototype.toString() concatenates error.name and error.message nicely
142+
// then we add the rest of the stack trace
143+
error.stack = error.toString() + '\n' + this._stack;
142144
onErrorOriginal.call(observer, error);
143145
});
144146
};

0 commit comments

Comments
 (0)