Add a widget to present errors nicely.
parent
8367767006
commit
b0cae39814
@ -0,0 +1,18 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import { pure } from 'recompose';
|
||||||
|
|
||||||
|
export const PrettyError = pure((props: any) => (
|
||||||
|
<div>
|
||||||
|
<h2>Something went wrong!</h2>
|
||||||
|
<pre>
|
||||||
|
{props.error.message}
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h3>Stack trace:</h3>
|
||||||
|
<pre>
|
||||||
|
{props.error.stack}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
));
|
||||||
|
|
||||||
|
export default PrettyError;
|
Loading…
Reference in New Issue