Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2197 | Rev 2205 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2197 Rev 2204
Línea 2... Línea 2...
2
import { connect } from 'react-redux'
2
import { connect } from 'react-redux'
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
import { addNotification } from '@app/redux/notification/notification.actions'
4
import { addNotification } from '@app/redux/notification/notification.actions'
5
 
5
 
-
 
6
class ErrorBoundary extends React.Component {
6
class ErrorBoundary extends React.Component {
7
  static handleError(error, errorInfo) {
7
  constructor(props) {
8
    console.log('ErrorBoundary caught an error: ', error, errorInfo)
8
    super(props)
-
 
9
    this.state = { hasError: false }
-
 
10
  }
9
    console.log(error.details)
11
 
10
    console.log(error.message)
12
  static getDerivedStateFromError() {
11
    console.log(errorInfo)
Línea 13... Línea 12...
13
    return { hasError: true }
12
    this.props.addNotification({ style: 'danger', msg: error.message })
14
  }
13
  }
15
 
-
 
16
  componentDidCatch(error, errorInfo) {
14
 
Línea 17... Línea 15...
17
    console.log('ErrorBoundary caught an error: ', error, errorInfo)
15
  componentDidCatch(error, errorInfo) {
18
    this.props.addNotification({ style: 'danger', msg: error.message })
16
    this.handleError(error, errorInfo)
19
  }
17
  }