Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialVincent Wang
1,976 PointsRedundant try-catch block?
In this video, if we already implemented a try-catch block for a parsing exception which would be thrown if there is an invalid JSON object, does this become redundant now that we have this error message for an unexpected https response, since when we look for an invalid profile it should return 404, and it won't bother with the parsing try-catch block
2 Answers
Steven Parker
231,261 PointsThese are different kinds of errors.
For example, what if your request was for a valid profile, but due to some internal error the server returned an invalid JSON object?
Christopher Debove
Courses Plus Student 18,373 PointsAsynchronous flow's errors are not caught by the external try-catch.
Vincent Wang
1,976 PointsVincent Wang
1,976 PointsI see, that makes sense thank you!