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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 e
      httpRequest - 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 e
      httpRequest - the http request
      Returns:
      the response entity