Skip to content

Commit fa90d27

Browse files
author
Eric Wendelin
committed
Only report errors from instrumented functions if they're parsable.
1 parent 2b8b0d4 commit fa90d27

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

dist/stacktrace.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
return target;
4646
}
4747

48+
function _isShapedLikeParsableError(err) {
49+
return err.stack || err['opera#sourceloc'];
50+
}
51+
4852
return {
4953
/**
5054
* Get a backtrace from invocation point.
@@ -56,7 +60,7 @@
5660
// Error must be thrown to get stack in IE
5761
throw new Error();
5862
} catch (err) {
59-
if (err.stack || err['opera#sourceloc']) {
63+
if (_isShapedLikeParsableError(err)) {
6064
return this.fromError(err, opts);
6165
} else {
6266
return this.generateArtificially(opts);
@@ -126,7 +130,9 @@
126130
this.get().then(callback, errback)['catch'](errback);
127131
fn.apply(thisArg || this, arguments);
128132
} catch (e) {
129-
this.fromError(e).then(callback, errback)['catch'](errback);
133+
if (_isShapedLikeParsableError(e)) {
134+
this.fromError(e).then(callback, errback)['catch'](errback);
135+
}
130136
throw e;
131137
}
132138
}.bind(this);

0 commit comments

Comments
 (0)