Skip to content

Commit

Permalink
chore: improve cors error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pnicolli committed Jun 4, 2024
1 parent e489cd9 commit acc886e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/customizations/volto/components/theme/Error/Error.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ const Error = (props) => {
}
}
libraries.Sentry.captureException(new MaybeCorsError(message), {
props,
contexts: {
props,
},
});
});
};
Expand Down
14 changes: 8 additions & 6 deletions src/customizations/volto/components/theme/View/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,14 @@ class View extends Component {
this.name = 'MaybeCorsError';
}
}
libraries.Sentry.captureException(
new MaybeCorsError(message, {
props: this.props,
isAnonymous: !this.props.token,
}),
);
libraries.Sentry.captureException(new MaybeCorsError(message), {
contexts: {
props: {
isAnonymous: !this.props.token,
...this.props,
},
},
});
});
};

Expand Down

0 comments on commit acc886e

Please sign in to comment.