dewarim / LittleGoblin

A browser game framework written in Grails
Other
10 stars 2 forks source link

Fix error handling #56

Open dewarim opened 9 years ago

dewarim commented 9 years ago

Currently there exists a haphazard way of logging exceptions (mostly: try...catch...log...throw, in each action.)

This should be replaced by explicit exception handlers, see: http://grails.org/doc/latest/guide/theWebLayer.html#controllerExceptionHandling

Note that ajax actions should always catch exceptions and render an appropriate response (i.e., mostly status 503 with a text message; but sometimes HTML / XML / JSON, as needed). Most non-ajax request should be fine with a generic error message page.

InputValidationService could throw "ValidationException" with custom message that an error page would explain the problem better than the generic 500-error-page for "throw new RuntimeException("error.missing.enum")"