CRUDErrorHandler

Default ExceptionHandler implementations for CRUDErrorException and unexpected exceptions

This is meant to be implemented from a @RestControllerAdvice class.

Functions

Link copied to clipboard
@ExceptionHandler(value = [CRUDErrorException::class])
open fun handleCRUDError(cee: CRUDErrorException): ResponseEntity<CRUDError>

Converts CRUDError in this exception into a ResponseEntity with correct status code, media type and body

Link copied to clipboard
@ExceptionHandler(value = [Exception::class])
open fun handleUnexpectedError(ex: Exception): ResponseEntity<CRUDError>

Converts any exception into a ResponseEntity with 500 Internal Server Error code and a generic message