Loading
Current section: 1. Promises 5 exercises
Problem

Rejection

Loading exercise

Transcript

00:00 Alright. So not always do things go the way that we planned or the way we wanted. Sometimes you make a network request and the user is not connected to the Internet anymore, or there's an error on the back end server, or for any number of reasons, things can go wrong. And so we need to handle what we call rejections, which is a fancy word for errors, but that's promise specific. So you can resolve a promise or you can reject a promise.

00:24 And, so in this exercise step, we're going to look at what happens if we reject. We've got an example here where if the ID is not equal to, the string one, then we're gonna say the user is not found. What do we do about that? I'm excited for you to play around with it.