Skip to content

Instantly share code, notes, and snippets.

@mlescaille
Created August 4, 2020 21:38
Show Gist options
  • Save mlescaille/093f09d4e7ec170e8d0169bc474fb780 to your computer and use it in GitHub Desktop.
Save mlescaille/093f09d4e7ec170e8d0169bc474fb780 to your computer and use it in GitHub Desktop.
Grails exception handler trait
import grails.converters.JSON
import com.mari.ApiError
trait ExceptionHandler {
def handleControllerError(Exception e) {
response.status = 400
render ApiError.unknownError as JSON
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment