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 trial
Ian Z
14,584 Pointsunhandled exception and "throws JSONexception" - what does it all mean?
private Forecast parseForecastDetails(String jsonData) { Forecast forecast = new Forecast();
forecast.setCurrent(getCurrentDetails(jsonData));
return forecast;
}
getCurrentDetails(jsonData)) has error unhandled exception and solution is to add "throws JSONexception" after method declaration
SO. what is all this throwing and catching? what are exceptions why do they need to be handled and thrown?, i think i missed this first time i went through videos and i dont know what to google to find them again
1 Answer
Patrick Corrigan
5,739 PointsThis video is the one where Ben explains this: https://teamtreehouse.com/library/build-a-weather-app/concurrency-and-error-handling/handling-errors