Build 576754stable
Module 260447
1,619 characters · in 8b3ffd4b288ba291.js, 331bf8185c686a13.jsDependencies
Source Raw
function(r,t,e){e.d(t,{z:()=>c});var n=e(64700),o=e(192308),l=e(139033),a=e(626584),i=e(38405),s=e(794400),u=e(375708);let d=new a.A("RevenueErrorBoundary.tsx");class c extends n.PureComponent{state={error:null,info:null};getSentryTags(r,t){return{app_context:this.getSentryAppContext(),...t?{crashed:"true"}:{}}}getSentryExtras(r){return r instanceof s.v&&null!=r.extraSentryInformation?{...r.extraSentryInformation}:{}}onErrorCaught(r,t){}closeAndShowAlert(){(0,o.closeAllModals)(),(0,l.A)({title:u.intl.string(u.t.iufib1),subtitle:u.intl.string(u.t.ZUEGFn),confirmText:u.intl.string(u.t.TyCVIq)})}getErrorHandlingBehavior(r){return r instanceof s.v?r.errorHandlingBehavior:this.props.errorHandlingBehavior}getCrashedFlag(r){return"rethrow"===this.getErrorHandlingBehavior(r)}emitSentryException(r,t){let{additionalAnalyticsData:e}=this.props,n=this.getCrashedFlag(r),o=this.getSentryExtras(r),l={tags:this.getSentryTags(r,n),extra:{...o,...e??{},...null!=t?{reactErrorInfo:t}:{}}};return r instanceof s.v&&r.skipReportingToSentry||i.A.captureException(r,l),d.error("Revenue error occurred:",{error:r,additionalErrorContext:o}),{sentryErrorOptions:l}}componentDidCatch(r,t){let{sentryErrorOptions:e}=this.emitSentryException(r,t);if(this.onErrorCaught(r,t),this.setState({error:r,info:t}),null!=this.props.onErrorReported&&this.props.onErrorReported(r,t,e),"rethrow"===this.getErrorHandlingBehavior(r))throw r;this.closeAndShowAlert()}render(){return null!=this.state.error?null!=this.props.renderCustomErrorComponent?this.props.renderCustomErrorComponent(this.state.error,this.state.info):null:this.props.children}}}