use of uk.ac.ebi.spot.goci.curation.dto.ErrorResponse in project goci by EBISPOT.
the class ExceptionHandlerAdvice method handleResourceNotFound.
@ExceptionHandler(ResourceNotFoundException.class)
public ResponseEntity<ErrorResponse> handleResourceNotFound(ResourceNotFoundException ex, HttpServletRequest req) {
ErrorResponse error = ErrorResponse.basicResponse(HttpStatus.NOT_FOUND, ex, req, dateFormat);
log.error(error.toString());
return new ResponseEntity<>(error, HttpStatus.NOT_FOUND);
}
use of uk.ac.ebi.spot.goci.curation.dto.ErrorResponse in project goci by EBISPOT.
the class ExceptionHandlerAdvice method handleDataIntegrityException.
@ExceptionHandler(DataIntegrityException.class)
public ResponseEntity<ErrorResponse> handleDataIntegrityException(DataIntegrityException ex, HttpServletRequest req) {
ErrorResponse error = ErrorResponse.basicResponse(HttpStatus.CONFLICT, ex, req, dateFormat);
log.error(error.toString());
return new ResponseEntity<>(error, HttpStatus.NOT_FOUND);
}
use of uk.ac.ebi.spot.goci.curation.dto.ErrorResponse in project goci by EBISPOT.
the class ExceptionHandlerAdvice method handleFileUploadException.
@ExceptionHandler(FileValidationException.class)
public ResponseEntity<ErrorResponse> handleFileUploadException(FileValidationException ex, HttpServletRequest req) {
ErrorResponse error = ErrorResponse.basicResponse(HttpStatus.BAD_REQUEST, ex, req, dateFormat);
ErrorResponse response = ErrorResponse.hibernateValidationResponse(error, ex.getBindingResult());
log.error(response.toString());
return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
}
Aggregations