I am trying to use beforeBreadcrumb
to pass along more error information from a network response, and I find that if I modify the breadcrumb
before returning it, for example with breadcrumb.data.errorMessage = response?.message;
, the breadcrumb shows up in the log as a generic/default breadcrumb with no data associated. Logging the breadcrumb directly before returning it shows the expected data is still there:
{
"timestamp": 1642071435.622,
"category": "fetch",
"data": {
"method": "POST",
"url": [redacted],
"status_code": 401,
"errorMessage": "The user credentials were incorrect."
},
"type": "http"
}
But none of this data is shown by the Sentry UI.
To troubleshoot, since the processing in the implementation is involved, I tried some simple debugging with this form of the hook:
beforeBreadcrumb(breadcrumb, hint) {
breadcrumb.data.errorMessage = 'xxx';
return breadcrumb;
},
This results in the error not being surfaced in Sentry entirely. When commenting the data
override line, the error is processed as normal.
Here I’m at a loss, as the docs indicate to add custom data under breadcrumb.data
. Any ideas? Many thanks in advance!