Package eu.europeana.apikey.exception
Class GlobalExceptionHandler
java.lang.Object
eu.europeana.api.commons.error.EuropeanaGlobalExceptionHandler
eu.europeana.apikey.exception.GlobalExceptionHandler
@ControllerAdvice
public class GlobalExceptionHandler
extends eu.europeana.api.commons.error.EuropeanaGlobalExceptionHandler
Global exception handler that catches all errors and logs the interesting ones
- Author:
- Patrick Ehlert Created on 18 nov 2019 Modified on 4 Feb 2021, Srishti Singh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<eu.europeana.api.commons.error.EuropeanaApiErrorResponse>handleException(org.springframework.http.converter.HttpMessageNotReadableException e, javax.servlet.http.HttpServletRequest httpRequest) Handle exception response entity.org.springframework.http.ResponseEntity<eu.europeana.api.commons.error.EuropeanaApiErrorResponse>handleInvalidMediaType(org.springframework.web.HttpMediaTypeNotSupportedException e, javax.servlet.http.HttpServletRequest httpRequest) Handle invalid media type response entity.Methods inherited from class eu.europeana.api.commons.error.EuropeanaGlobalExceptionHandler
handleEuropeanaBaseException, handleHttpMethodNotSupportedException, handleInputValidationError, handleInputValidationError, handleMediaTypeNotAcceptableException, handleMethodArgNotValidException, handleOtherExceptionTypes, logException, stackTraceEnabled
-
Constructor Details
-
GlobalExceptionHandler
public GlobalExceptionHandler()
-
-
Method Details
-
handleException
@ExceptionHandler public org.springframework.http.ResponseEntity<eu.europeana.api.commons.error.EuropeanaApiErrorResponse> handleException(org.springframework.http.converter.HttpMessageNotReadableException e, javax.servlet.http.HttpServletRequest httpRequest) Handle exception response entity.- Parameters:
e- the ehttpRequest- the http request- Returns:
- the response entity
-
handleInvalidMediaType
@ExceptionHandler(org.springframework.web.HttpMediaTypeNotSupportedException.class) public org.springframework.http.ResponseEntity<eu.europeana.api.commons.error.EuropeanaApiErrorResponse> handleInvalidMediaType(org.springframework.web.HttpMediaTypeNotSupportedException e, javax.servlet.http.HttpServletRequest httpRequest) Handle invalid media type response entity.- Parameters:
e- the ehttpRequest- the http request- Returns:
- the response entity
-