File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -1369,7 +1369,7 @@ Raven.prototype = {
1369
1369
var frames = [ ] ;
1370
1370
if ( stackInfo . stack && stackInfo . stack . length ) {
1371
1371
each ( stackInfo . stack , function ( i , stack ) {
1372
- var frame = self . _normalizeFrame ( stack ) ;
1372
+ var frame = self . _normalizeFrame ( stack , stackInfo . url ) ;
1373
1373
if ( frame ) {
1374
1374
frames . push ( frame ) ;
1375
1375
}
@@ -1386,8 +1386,21 @@ Raven.prototype = {
1386
1386
return frames ;
1387
1387
} ,
1388
1388
1389
- _normalizeFrame : function ( frame ) {
1390
- if ( ! frame . url ) return ;
1389
+ _normalizeFrame : function ( frame , stackInfoUrl ) {
1390
+ if ( ! frame . url ) {
1391
+ // Case when we don't have any information about the error
1392
+ // E.g. throwing a string or raw object in Firefox
1393
+ // Generating synthetic error doesn't add any value here
1394
+ //
1395
+ // We should probably somehow let user know that he should fix his code
1396
+ return {
1397
+ filename : stackInfoUrl , // fallback to whole stacks url from onerror handler
1398
+ lineno : frame . line ,
1399
+ colno : frame . column ,
1400
+ function : frame . func || '?' , // if we dont have a file url, we most likely won't have a function name either
1401
+ in_app : true // this will always come from the user's code
1402
+ } ;
1403
+ }
1391
1404
1392
1405
// normalize the frames data
1393
1406
var normalized = {
You can’t perform that action at this time.
0 commit comments