Browse Source
Merge pull request #678 from gre/always-show-errors
Always show error in the RenderError
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
18 additions and
15 deletions
src/components/RenderError.js
src/renderer/init.js
@ -10,12 +10,10 @@ import hardReset from 'helpers/hardReset'
import type { T } from 'types/common'
import Spoiler from 'components/base/Spoiler'
import ExportLogsBtn from 'components/ExportLogsBtn'
import Box from 'components/base/Box'
import Space from 'components/base/Space'
import Button from 'components/base/Button'
import TranslatedError from './TranslatedError'
type Props = {
error : Error ,
@ -94,17 +92,23 @@ ${error.stack}
{ t ( 'app:crash.reset' ) }
< / B u t t o n >
< / B o x >
< Space of = { 20 } / >
< Spoiler color = "wallet" title = { t ( 'app:crash.showError' ) } >
< Box my = { 6 } >
< ErrContainer >
< TranslatedError error = { error } / >
< strong > { String ( error ) } < / s t r o n g >
< div > { error . stack || 'no stacktrace' } < / d i v >
< / E r r C o n t a i n e r >
< / S p o i l e r >
< Space of = { 10 } / >
< Spoiler color = "wallet" title = { t ( 'app:crash.showDetails' ) } >
< ErrContainer > { error . stack } < / E r r C o n t a i n e r >
< / S p o i l e r >
< Space of = { 100 } / >
< / B o x >
< pre
style = { {
position : 'fixed' ,
bottom : 8 ,
left : 8 ,
opacity : 0.2 ,
fontSize : 10 ,
} }
>
{ __ APP_VERSION__ }
< / p r e >
{ children }
< / B o x >
)
@ -114,14 +118,14 @@ ${error.stack}
const ErrContainer = ( { children } : { children : any } ) => (
< pre
style = { {
marginTop : 10 ,
maxWidth : '80% ' ,
margin : 'auto' ,
maxWidth : '80vw ' ,
overflow : 'auto' ,
fontSize : 10 ,
fontFamily : 'monospace' ,
background : 'rgba(0, 0, 0, 0.05)' ,
cursor : 'text' ,
userSelect : 'text' ,
opacity : 0.3 ,
} }
>
{ children }
@ -98,7 +98,6 @@ function r(Comp) {
}
init ( ) . catch ( e => {
// for now we make the app crash instead of pending forever. later we can render the error OR try to recover, but probably this is unrecoverable cases.
logger . critical ( e )
r ( < AppError error = { e } language = "en" / > )
} )