Skip to content

core(errors-in-console): If exception info is not present use exception text#4191

Merged
paulirish merged 2 commits intomasterfrom
bug/exceptions-description-undefined
Jan 8, 2018
Merged

core(errors-in-console): If exception info is not present use exception text#4191
paulirish merged 2 commits intomasterfrom
bug/exceptions-description-undefined

Conversation

@wardpeet
Copy link
Collaborator

@wardpeet wardpeet commented Jan 6, 2018

Fixes #4188

when looking at the devtools protocol. Exeption is an optional property, when not present we should use text.

I also added an extra test to cover this case.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for quickly fixing @wardpeet! did you get a repro on that URL mentioned in the issue/sentry and this returns a real message in that case?

assert.equal(auditResult.details.items.length, 1);
// url is undefined
assert.strictEqual(auditResult.details.items[0][0].text, 'http://example.com/fancybox.js');
// text is undefined
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what these two comments are, isn't text defined here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I did, it happens when a syntax error occurred on the page.

{
   "timestamp":1515451440948.461,
   "exceptionDetails":{
      "exceptionId":1,
      "text":"Uncaught SyntaxError: Unexpected token ,",
      "lineNumber":3180,
      "columnNumber":302,
      "scriptId":"56",
      "url":"https://enterprise.efax.com/",
      "stackTrace":{
         "callFrames":[
            {
               "functionName":"prop",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":22254
            },
            {
               "functionName":"access",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":6743
            },
            {
               "functionName":"prop",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":18120
            },
            {
               "functionName":"",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":88,
               "columnNumber":274
            },
            {
               "functionName":"each",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":5254
            },
            {
               "functionName":"each",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":2010
            },
            {
               "functionName":"b",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":88,
               "columnNumber":190
            },
            {
               "functionName":"",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":89,
               "columnNumber":472
            },
            {
               "functionName":"c",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":7854
            },
            {
               "functionName":"fireWith",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":8655
            },
            {
               "functionName":"ready",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":3263
            },
            {
               "functionName":"H",
               "scriptId":"32",
               "url":"https://d9jmv9u00p0mv.cloudfront.net/js/10015692-10015098.js",
               "lineNumber":8,
               "columnNumber":692
            }
         ]
      }
   }
}

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome thanks @wardpeet! 👍

@paulirish paulirish merged commit 0ea37de into master Jan 8, 2018
@paulirish paulirish deleted the bug/exceptions-description-undefined branch January 8, 2018 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants