Grails Generic Exception Handling Mechanism -
i newbie in grails , trying find best way exception handling in grails. using grails 2.4.2 spring secxurity core.
following scenarios needs considered. phone call grails app web call/ajax call/ restful call. response type expected json/text/xml/html exceptions occur in layer of application(filters, controllers, service, domain, taglib, database) proper http status code has set exception. (could same exceptions) want have to the lowest degree impact on coding since grails reduces boiler plate code lot, don't want end writing redundant codes in each controller.
consider above scenario's best possible approach on this.
based on format type( content-negotiation in grails determine response type provided). looking @ traits way of adding exception handling in controller implementing traits controllers defined in grails user documentation. happen security exceptions beingness thrown spring-security.
when create ajax calls, believe error phone call on ajax client determined status code of http response code.
what need way forwards exceptions occur generic error controller should have access root cause, messages associated , build html/text/json/xml response out of , render client.
is possible accomplish this. inputs highly appreciated.
thanks in advance
exception grails
No comments:
Post a Comment