componentDidCatch receives the error and error information, making it a common place to log errors to a reporting service.