I am trying to send an error message from the grails controller to the Grails error controller in order to display the error message in the HTTP response, but I'm not sure which parameter contains the error message in the error controller.
URLMappings.groovy
All 500 errors are displayed in ErrorsController
"500"(controller: "errors", action: "serverError")
GenericController
def {
try{
}catch(Exception e){
response.sendError(500, e.getMessage())
}
}
Errorscontroller
def serverError = {
render( how can I access the exception details here?? )
}
I need to access the exception in ErrorsController so that I can output it in an HTTP response.
source
share