erikras / erikras/react-redux-universal-hot-example

App level error handling/logging best practice?

Open
#1,275 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

Did a quick search but didn't find much discussion on this topic. I'm wondering what the best practice for app level error handling and logging. I posted the question here because this is the boilerplate my app is building on.

Regardless how careful I am, occasionally there still will be uncaught errors popping out, and sometimes they just throw the entire app off. In production environment, this is quite undesirable. In the minimum I'd like to have some sort of "catch all" error handling, which should log the error on server side so that I can see what was going on. I came across [(this solution)](http://stackoverflow.com/a/31116583/4401488) but for some reason the `errorObject` is always `null` so it's pretty much useless. The only thing I changed was to invoke `startErrorLog()` in `componentDidMount()` as opposed in `componentWillMount()`, because `window` is `undefined` in `componentWillMount()` due to server side rendering. It would be helpful if anyone could share anything.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.