Hacker News new | past | comments | ask | show | jobs | submit login

I think the idea of try/catch is to let the error bubble up to the place where it can be handled. It usually results into having error handling in a few central places. Your example in github is IMO not how to make best use of try/catch.

Here’s lots of typical exception handling patterns: http://wiki.c2.com/?ExceptionPatterns

Persobally I prefer exceptions over boilerplate “if’s”, but good to know that there’s a wrapper for the people who don’t.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: