Error Handling in Promises
In this lab, you will learn the basics of handling errors in promises. You will create a function called
fetchData that returns a promise. You will then use the
.catch() methods to handle success and error scenarios respectively. Finally, you'll reject the promise with an error message.