UNPKG

@embrace-io/web-sdk

Version:
3 lines (2 loc) 702 B
import*as r from"react";import{log as t}from"../../../../api-logs/logAPI.js";import{EMB_ERROR_INSTRUMENTATIONS as o,KEY_EMB_INSTRUMENTATION as a}from"../../../../constants/attributes.js";class e extends r.Component{constructor(r){super(r),this._logManager=t.getLogManager(),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,t){var e;this._logManager.logException(r,{handled:!1,attributes:{"react.component_stack":null!==(e=t.componentStack)&&void 0!==e?e:void 0,[a]:o.ReactErrorBoundary}})}render(){return this.state.hasError?this.props.fallback():this.props.children}}export{e as EmbraceErrorBoundary}; //# sourceMappingURL=EmbraceErrorBoundary.js.map