summaryrefslogtreecommitdiff
path: root/ui/app/components/error_panel.js
blob: 7b360448ba034f73b02d226bd74e4917ff658131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from 'react'
import Center from './center'
import Area from './area'

export default class ErrorPanel extends React.Component {

  constructor(props) {
    super(props)
  }

  render () {
    var error_msg = null
    var error = this.props.error
    console.log(error)
    if (error instanceof Error && error.stack) {
      error_msg = error.stack
    } else if (error instanceof PromiseRejectionEvent) {
      error_msg = "Error connecting to bitmaskd"
    } else {
      error_msg = error.toString()
    }
    return (
      <Center width="600">
        <Area>
          <h1>Error</h1>
          {error_msg}
        </Area>
      </Center>
    )
  }
}