On Fri, 26 Jul 2013 14:40:47 GMT, Manu Evans wrote:

If simple form handling logic is potentially throw-ing all over the place, what is the typical structure/flow to handle errors gracefully?
Are there any idiomatic examples of this sort of code?

In my experience it always boils down to separating validation of user input (which is expected to throw a lot) into separate part of application and process already sanitized input further. You can catch exceptions in top-most block of former and use it to render nice error message to user about invalid input. Any exception thrown after is likely to be some weird internal server error and default handler which renders status code 500 makes perfect sense.

I think designing even small apps in generic and clean way really pays it off and using script-like approach of simply going and processing stuff is fundamentally flawed.