redo sentry tag key and values, move ErrorBoundary around embed

This commit is contained in:
Ben Wheeler 2019-10-10 13:15:35 -04:00
parent 487ca236be
commit 91a05d636f
5 changed files with 10 additions and 11 deletions

View file

@ -19,7 +19,7 @@ class ErrorBoundary extends React.Component {
Sentry.withScope(scope => { Sentry.withScope(scope => {
scope.setTag('project', 'scratch-www'); scope.setTag('project', 'scratch-www');
if (this.props.name) { if (this.props.name) {
scope.setTag('errorboundary', this.props.name); scope.setTag('component', this.props.name);
} }
Object.keys(errorInfo).forEach(key => { Object.keys(errorInfo).forEach(key => {
scope.setExtra(key, errorInfo[key]); scope.setExtra(key, errorInfo[key]);

View file

@ -10,7 +10,7 @@ const Page = ({
children, children,
className className
}) => ( }) => (
<ErrorBoundary name="page"> <ErrorBoundary name="Page">
<div className={classNames('page', className)}> <div className={classNames('page', className)}>
<div <div
className={classNames({ className={classNames({

View file

@ -10,7 +10,7 @@ initSentry();
require('./join.scss'); require('./join.scss');
const Register = () => ( const Register = () => (
<ErrorBoundary name="join"> <ErrorBoundary name="Join">
<div className="join"> <div className="join">
<a <a
aria-label="Scratch" aria-label="Scratch"

View file

@ -5,7 +5,6 @@ const PropTypes = require('prop-types');
const connect = require('react-redux').connect; const connect = require('react-redux').connect;
const injectIntl = require('react-intl').injectIntl; const injectIntl = require('react-intl').injectIntl;
const ErrorBoundary = require('../../components/errorboundary/errorboundary.jsx');
const projectShape = require('./projectshape.jsx').projectShape; const projectShape = require('./projectshape.jsx').projectShape;
const NotAvailable = require('../../components/not-available/not-available.jsx'); const NotAvailable = require('../../components/not-available/not-available.jsx');
const Meta = require('./meta.jsx'); const Meta = require('./meta.jsx');
@ -35,11 +34,9 @@ class EmbedView extends React.Component {
render () { render () {
if (this.props.projectNotAvailable || this.state.invalidProject) { if (this.props.projectNotAvailable || this.state.invalidProject) {
return ( return (
<ErrorBoundary name="embed">
<div className="preview"> <div className="preview">
<NotAvailable /> <NotAvailable />
</div> </div>
</ErrorBoundary>
); );
} }

View file

@ -13,7 +13,9 @@ const UnsupportedBrowser = require('./unsupported-browser.jsx');
if (isSupportedBrowser()) { if (isSupportedBrowser()) {
const EmbedView = require('./embed-view.jsx'); const EmbedView = require('./embed-view.jsx');
render( render(
<EmbedView.View />, <ErrorBoundary name="EmbedView">
<EmbedView.View />
</ErrorBoundary>,
document.getElementById('app'), document.getElementById('app'),
{ {
preview: previewActions.previewReducer, preview: previewActions.previewReducer,
@ -27,7 +29,7 @@ if (isSupportedBrowser()) {
); );
} else { } else {
render( render(
<ErrorBoundary name="unsupportedbrowser"><UnsupportedBrowser /></ErrorBoundary>, <ErrorBoundary name="UnsupportedBrowser"><UnsupportedBrowser /></ErrorBoundary>,
document.getElementById('app') document.getElementById('app')
); );
} }