use of com.haulmont.restapi.exception.ErrorInfo in project cuba by cuba-platform.
the class RestControllerExceptionHandler method handleMethodResultValidationException.
@ExceptionHandler(MethodResultValidationException.class)
@ResponseBody
public ResponseEntity<ErrorInfo> handleMethodResultValidationException(MethodResultValidationException e) {
log.error("MethodResultValidationException in service", e);
ErrorInfo errorInfo = new ErrorInfo("Server error", "");
return new ResponseEntity<>(errorInfo, HttpStatus.INTERNAL_SERVER_ERROR);
}
use of com.haulmont.restapi.exception.ErrorInfo in project cuba by cuba-platform.
the class RestControllerExceptionHandler method handleValidationException.
@ExceptionHandler(ValidationException.class)
@ResponseBody
public ResponseEntity<ErrorInfo> handleValidationException(ValidationException e) {
log.error("ValidationException in service", e);
ErrorInfo errorInfo = new ErrorInfo("Server error", "");
return new ResponseEntity<>(errorInfo, HttpStatus.INTERNAL_SERVER_ERROR);
}
use of com.haulmont.restapi.exception.ErrorInfo in project cuba by cuba-platform.
the class RestControllerExceptionHandler method handleException.
@ExceptionHandler(Exception.class)
@ResponseBody
public ResponseEntity<ErrorInfo> handleException(Exception e) {
log.error("Exception in REST controller", e);
ErrorInfo errorInfo = new ErrorInfo("Server error", "");
return new ResponseEntity<>(errorInfo, HttpStatus.INTERNAL_SERVER_ERROR);
}
use of com.haulmont.restapi.exception.ErrorInfo in project cuba by cuba-platform.
the class RestControllerExceptionHandler method handleRowLevelSecurityException.
@ExceptionHandler(RowLevelSecurityException.class)
@ResponseBody
public ResponseEntity<ErrorInfo> handleRowLevelSecurityException(RowLevelSecurityException e) {
log.error("RowLevelSecurityException in service", e);
ErrorInfo errorInfo = new ErrorInfo("Forbidden", e.getMessage());
return new ResponseEntity<>(errorInfo, HttpStatus.FORBIDDEN);
}
Aggregations