https://devhubby.com/thread/how-to-handle-errors-in-a-react-component