Created
August 4, 2020 21:38
-
-
Save mlescaille/093f09d4e7ec170e8d0169bc474fb780 to your computer and use it in GitHub Desktop.
Grails exception handler trait
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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