MM-11018 Provide default message for Sentry breadcrumbs (#1819)
This commit is contained in:
parent
a9508d30f9
commit
599fa7b4e1
1 changed files with 6 additions and 7 deletions
|
|
@ -19,23 +19,22 @@ export function createSentryMiddleware() {
|
|||
}
|
||||
|
||||
function makeBreadcrumbFromAction(action) {
|
||||
if (!action.type) {
|
||||
console.warn('dispatching action with undefined type', action); // eslint-disable-line no-console
|
||||
}
|
||||
|
||||
const breadcrumb = {
|
||||
category: BREADCRUMB_REDUX_ACTION,
|
||||
message: action.type,
|
||||
message: action.type || 'undefined action',
|
||||
};
|
||||
|
||||
if (action.type === BATCH) {
|
||||
// Attach additional information so that batched actions display what they're doing
|
||||
breadcrumb.data = action.payload.map((a) => a.type);
|
||||
}
|
||||
|
||||
if (action.type === BATCH) {
|
||||
// Attach additional information so that batched actions display what they're doing, and make it
|
||||
// into an object because that's what is expected
|
||||
breadcrumb.data = {};
|
||||
|
||||
action.payload.forEach((a, index) => {
|
||||
breadcrumb.data[index] = a.type;
|
||||
breadcrumb.data[index] = a.type || 'undefined action';
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue