-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unhandledrejection
disregards the reason
, can't get proper stack trace in userTransform
#307
Comments
Hi @alexilyaev and thank you for the detailed write-up + repro. Which browser are you using? I tried on Chrome 58 and saw that the payload sent to the Rollbar server included the correct message in I suspect that this is browser-specific and we need to add some code to the unhandled rejection logic to handle Here's the payload I saw when I ran the repro code: {
"access_token": "POST_CLIENT_ITEM_ACCESS_TOKEN",
"data": {
"environment": "development",
"level": "error",
"endpoint": "api.rollbar.com\/api\/1\/",
"platform": "browser",
"framework": "browser-js",
"language": "javascript",
"server": {
},
"notifier": {
"name": "rollbar-browser-js",
"version": "2.0.4"
},
"request": {
"url": "https:\/\/fiddle.jshell.net\/_display\/",
"query_string": "",
"user_ip": "$remote_ip"
},
"client": {
"runtime_ms": 891,
"timestamp": 1497041850,
"javascript": {
"browser": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36",
"language": "en-US",
"cookie_enabled": true,
"screen": {
"width": 1440,
"height": 900
},
"plugins": [
{
"name": "Widevine Content Decryption Module",
"description": "Enables Widevine licenses for playback of HTML audio\/video content. (version: 1.4.8.970)"
},
{
"name": "Chrome PDF Viewer",
"description": ""
},
{
"name": "Native Client",
"description": ""
},
{
"name": "Chrome PDF Viewer",
"description": "Portable Document Format"
}
]
}
},
"body": {
"trace": {
"exception": {
"class": "Error",
"message": "Why u no trace?"
},
"frames": [
{
"filename": "https:\/\/fiddle.jshell.net\/_display\/",
"lineno": 48,
"method": "[anonymous]",
"colno": 14
}
]
}
}
}
} |
@coryvirok I"m using Chrome 58/59 as well, my results match yours, I wasn't specific enough on the use case...
Another repro, with server response: As you can see, I can't tell anything from this, not the message and not a proper trace.
|
I see. I was able to repro this by changing this line of your jsFiddle: reject({new Error('Why u no trace?')}); to reject({some:"object here"}); @rokob can you take a look at this? |
This is always how this has been though right? Line 593 in 7717f62
The payload that is passed to the transform function only comes from Line 731 in 7717f62
Line 739 in 7717f62
We can change this to add whatever is passed as reason to create the item which will add it to custom. |
Hi,
Test case:
https://jsfiddle.net/etu4g6qc/5/
I'm having an issue with debugging an
unhandledrejection
of a Promise that I"m not handling.I"m currently logging such errors to a logging service, and what I see is
[object Object]
anda short stack trace from Bluebird which doesn't help at all.
After hours of debugging every piece of code I could, I found this:
https://github.com/rollbar/rollbar.js/blob/master/dist/rollbar.umd.js#L209
reason
here came fromevent.detail
(rejectionHandler at https://github.com/rollbar/rollbar.js/blob/master/dist/rollbar.umd.js#L2653) and it's just an Object, not an Error instance, so theitem
that's created disregardsreason
.When debugging in a real world test case I saw that
reason
contained all of the information I needed (the actual object sent from the server as an error response).Issues:
payload
that's passed totransform
(fromUserTransform
) does not containreason
, so I can't log essential details to the logging service.body.trace.exception.message
is[object Object]
Would appreciate your help.
The text was updated successfully, but these errors were encountered: