Enhance ErrorBoundary component with stacktrace + version info

This commit is contained in:
Roman Hotsiy 2017-11-22 13:02:56 +02:00
parent 63dfdebf6a
commit 37b6dff94b
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -22,8 +22,16 @@ export class ErrorBoundary extends React.Component<{}, { error?: Error }> {
if (this.state.error) {
return (
<ErrorWrapper>
<h1>Something went wrong.</h1>
<h1>Something went wrong...</h1>
<small> {this.state.error.message} </small>
<p>
<details>
<summary>Stack trace</summary>
<pre>{this.state.error.stack}</pre>
</details>
</p>
<small> ReDoc Version: {__REDOC_VERSION__}</small> <br />
<small> Commit: {__REDOC_REVISION__}</small>
</ErrorWrapper>
);
}