Currently in the <Play> and <Image Capture> components you're catching errors from your promises, one for starting the camera, one for retrieving the emotion analysis from the server but those are just being console logged. It would be good to think of the sad-path and have a way of displaying a message to the user saying that their camera couldn't be started and/or there was a problem fetching the analysis from the server etc. You could have an empty errorMessage entry in your state and update state in the catch block if an error occurs.
Currently in the
<Play>
and<Image Capture>
components you're catching errors from your promises, one for starting the camera, one for retrieving the emotion analysis from the server but those are just being console logged. It would be good to think of the sad-path and have a way of displaying a message to the user saying that their camera couldn't be started and/or there was a problem fetching the analysis from the server etc. You could have an emptyerrorMessage
entry in your state and update state in thecatch
block if an error occurs.