Design comparison
Solution retrospective
Hello! This is my first time using the fetch()
API, any feedback on the JS function implementation would be helpful, thank you!
Community feedback
- @NatureSon22Posted over 1 year ago
When using fetch, it's important to include a catch block as well. The catch block is responsible for capturing any potential errors that might arise during the program's execution, preventing the entire program from stopping unexpectedly. What can we include within the catch block? You have the option to show the user an element describing the issue, or you can display a simple prompt indicating that an error has occurred. This approach is user-friendly and straightforward.
Marked as helpful1@mbdelarosaPosted about 1 year ago@NatureSon22 Thank you for the comment! Have updated my solution with a try-catch, will keep this in mind for future challenges as well.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord