MCPcopy Create free account
hub / github.com/msgbyte/tailchat / render

Method render

client/web/src/components/ErrorBoundary.tsx:37–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 };
36
37 render() {
38 const { message, description, children } = this.props;
39 const { error, info } = this.state;
40 const componentStack =
41 info && info.componentStack ? info.componentStack : null;
42 const errorMessage =
43 typeof message === 'undefined' ? (error || '').toString() : message;
44 const errorDescription =
45 typeof description === 'undefined' ? componentStack : description;
46
47 if (error) {
48 return (
49 <Problem
50 text={
51 <>
52 <h3>{t('页面出现了一些问题')}</h3>
53 <p title={errorDescription ?? ''}>{errorMessage}</p>
54 <Button size="small" onClick={this.reset}>
55 {t('重试')}
56 </Button>
57 </>
58 }
59 />
60 );
61 }
62
63 return children;
64 }
65}

Callers 1

index.tsxFile · 0.45

Calls 2

toStringMethod · 0.80
tFunction · 0.50

Tested by

no test coverage detected