Gestion d'erreurs

pull/913/head
Mael 2019-11-19 19:01:07 +01:00 committed by Maxime Quandalle
parent 8657435f46
commit cf743d362a
1 changed files with 10 additions and 1 deletions

View File

@ -105,7 +105,16 @@ class ErrorBoundary extends React.Component {
render() {
return (
<>
{this.state.error && <p>Erreur : {JSON.stringify(this.state.error)}</p>}
{this.state.error && (
<p css="max-height: 4rem; overflow: hidden; border: 3px solid red;">
Erreur :{' '}
{
this.state.error.message.split(
'The error may be correlated with'
)[0]
}
</p>
)}
{this.props.children}
</>
)