From 0f8eb638cc5d0547ac74f6192cab4c4699a06640 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Wed, 9 Oct 2019 22:30:35 -0400 Subject: [PATCH] add support in ErrorBoundary for setting errorboundary tag --- src/components/errorboundary/errorboundary.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/errorboundary/errorboundary.jsx b/src/components/errorboundary/errorboundary.jsx index 90bd7b368..22cc94351 100644 --- a/src/components/errorboundary/errorboundary.jsx +++ b/src/components/errorboundary/errorboundary.jsx @@ -17,6 +17,9 @@ class ErrorBoundary extends React.Component { componentDidCatch (error, errorInfo) { // Display fallback UI Sentry.withScope(scope => { + if (this.props.name) { + scope.setTag('errorboundary', this.props.name); + } Object.keys(errorInfo).forEach(key => { scope.setExtra(key, errorInfo[key]); }); @@ -46,7 +49,8 @@ class ErrorBoundary extends React.Component { } } ErrorBoundary.propTypes = { - children: PropTypes.node + children: PropTypes.node, + name: PropTypes.string }; module.exports = ErrorBoundary;