From acc886ea9d3c6e60ddae64c0cf5e736c3b4fba5c Mon Sep 17 00:00:00 2001 From: Piero Nicolli Date: Tue, 4 Jun 2024 12:10:50 +0200 Subject: [PATCH] chore: improve cors error logging --- .../volto/components/theme/Error/Error.jsx | 4 +++- .../volto/components/theme/View/View.jsx | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/customizations/volto/components/theme/Error/Error.jsx b/src/customizations/volto/components/theme/Error/Error.jsx index 80ca4fd12..18eacaa0f 100644 --- a/src/customizations/volto/components/theme/Error/Error.jsx +++ b/src/customizations/volto/components/theme/Error/Error.jsx @@ -44,7 +44,9 @@ const Error = (props) => { } } libraries.Sentry.captureException(new MaybeCorsError(message), { - props, + contexts: { + props, + }, }); }); }; diff --git a/src/customizations/volto/components/theme/View/View.jsx b/src/customizations/volto/components/theme/View/View.jsx index 11bfdbdd7..738f6592b 100644 --- a/src/customizations/volto/components/theme/View/View.jsx +++ b/src/customizations/volto/components/theme/View/View.jsx @@ -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, + }, + }, + }); }); };