Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2205 | Rev 2209 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1197 stevensc 1
import React from 'react'
2
import { connect } from 'react-redux'
1202 stevensc 3
 
1565 stevensc 4
import { addNotification } from '@app/redux/notification/notification.actions'
1197 stevensc 5
 
6
class ErrorBoundary extends React.Component {
2205 stevensc 7
  componentDidCatch(error, errorInfo) {
8
    console.log('Error message', error.message)
2204 stevensc 9
    console.log('ErrorBoundary caught an error: ', error, errorInfo)
2206 stevensc 10
    this.props.addNotification({ style: 'danger', msg: 'Fatal error' })
1606 stevensc 11
  }
12
 
1197 stevensc 13
  render() {
14
    return this.props.children
15
  }
16
}
17
 
2205 stevensc 18
export default connect(null, { addNotification })(ErrorBoundary)