core(errors-in-console): If exception info is not present use exception text#4191
Merged
core(errors-in-console): If exception info is not present use exception text#4191
Conversation
patrickhulce
reviewed
Jan 8, 2018
Collaborator
patrickhulce
left a comment
There was a problem hiding this comment.
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 |
Collaborator
There was a problem hiding this comment.
not sure what these two comments are, isn't text defined here?
Collaborator
Author
There was a problem hiding this comment.
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
}
]
}
}
}
patrickhulce
approved these changes
Jan 8, 2018
Collaborator
patrickhulce
left a comment
There was a problem hiding this comment.
awesome thanks @wardpeet! 👍
paulirish
approved these changes
Jan 8, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.