terriajs
Version:
Geospatial data visualization platform.
19 lines • 586 B
JavaScript
import { Component } from "react";
/**
* An error boundary that raises the error to the user.
*/
export default class RaiseToUserErrorBoundary extends Component {
state = { hasError: false };
static getDerivedStateFromError(_error) {
return {
hasError: true
};
}
componentDidCatch(error, _errorInfo) {
this.props.viewState.terria.raiseErrorToUser(error, this.props.terriaErrorOptions);
}
render() {
return this.state.hasError ? null : this.props.children;
}
}
//# sourceMappingURL=RaiseToUserErrorBoundary.js.map