Skip to content

Commit

Permalink
Merge pull request #554 from getsentry/opera-mini
Browse files Browse the repository at this point in the history
Parse exception type out of Opera Mini messages (fixes #546)
  • Loading branch information
benvinegar committed Apr 19, 2016
2 parents d1050ce + f180ee2 commit e3099eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion test/vendor/tracekit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,17 @@ describe('TraceKit', function(){
TraceKit.report.subscribe(subscriptionHandler);
// should work with/without "Uncaught"
window.onerror('Uncaught ReferenceError: foo is undefined', 'http://example.com', testLineNo);
window.onerror('ReferenceError: foo is undefined', 'http://example.com', testLineNo)
window.onerror('ReferenceError: foo is undefined', 'http://example.com', testLineNo);
done();
});

it('should separate name, message for default error types on Opera Mini (see #546)', function (done) {
subscriptionHandler = function (stackInfo, extra) {
assert.equal(stackInfo.name, 'ReferenceError');
assert.equal(stackInfo.message, 'Undefined variable: foo');
};
TraceKit.report.subscribe(subscriptionHandler);
window.onerror('Uncaught exception: ReferenceError: Undefined variable: foo', 'http://example.com', testLineNo);
done();
});

Expand Down
2 changes: 1 addition & 1 deletion vendor/TraceKit/tracekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var _slice = [].slice;
var UNKNOWN_FUNCTION = '?';

// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
var ERROR_TYPES_RE = /^(?:Uncaught )?((?:Eval|Internal|Range|Reference|Syntax|Type|URI)Error)\: ?(.*)$/;
var ERROR_TYPES_RE = /^(?:Uncaught (?:exception: )?)?((?:Eval|Internal|Range|Reference|Syntax|Type|URI)Error): ?(.*)$/;

function getLocationHref() {
if (typeof document === 'undefined')
Expand Down

0 comments on commit e3099eb

Please sign in to comment.