Package energy.eddie.aiida.errors
Class GlobalExceptionHandler
java.lang.Object
energy.eddie.aiida.errors.GlobalExceptionHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleBadRequestExceptions(Exception exception) org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleConflictExceptions(Exception exception) org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleForbiddenExceptions(Exception exception) org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleHttpMessageNotReadableException(org.springframework.http.converter.HttpMessageNotReadableException exception) If the HttpMessageNotReadableException was caused by an invalid enum value, a detailed error message including valid enum values is returned, otherwise a generic error message is returned.org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleInstallerException(InstallerException exception) org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleMethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException ex) org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleNotFoundExceptions(Exception exception) org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleServiceUnavailableExceptions(Exception exception) org.springframework.http.ResponseEntity<Map<String, List<EddieApiError>>> handleUnauthorizedException(Exception exception)
-
Constructor Details
-
GlobalExceptionHandler
public GlobalExceptionHandler()
-
-
Method Details
-
handleHttpMessageNotReadableException
@ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleHttpMessageNotReadableException(org.springframework.http.converter.HttpMessageNotReadableException exception) If the HttpMessageNotReadableException was caused by an invalid enum value, a detailed error message including valid enum values is returned, otherwise a generic error message is returned.- Parameters:
exception- HttpMessageNotReadableException Exception that occurred during request parsing.- Returns:
- ResponseEntity with status code 400 and an error message.
-
handleMethodArgumentNotValidException
@ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleMethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException ex) -
handleBadRequestExceptions
@ExceptionHandler({ImageFormatException.class,ImageReadException.class,InvalidDataSourceTypeException.class,ModbusDeviceConfigException.class,PermissionAlreadyExistsException.class}) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleBadRequestExceptions(Exception exception) -
handleUnauthorizedException
@ExceptionHandler({InvalidUserException.class,MqttUnauthorizedException.class,UnauthorizedException.class}) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleUnauthorizedException(Exception exception) -
handleForbiddenExceptions
@ExceptionHandler(DataSourceSecretGenerationNotSupportedException.class) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleForbiddenExceptions(Exception exception) -
handleNotFoundExceptions
@ExceptionHandler({DataSourceNotFoundException.class,ImageNotFoundException.class,InboundRecordNotFoundException.class,LatestAiidaRecordNotFoundException.class,LatestPermissionRecordNotFoundException.class,MqttTlsCertificateNotFoundException.class,PermissionNotFoundException.class,SinapsiAlflaEmptyConfigException.class}) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleNotFoundExceptions(Exception exception) -
handleConflictExceptions
@ExceptionHandler({PermissionUnfulfillableException.class,PermissionStateTransitionException.class}) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleConflictExceptions(Exception exception) -
handleInstallerException
@ExceptionHandler(InstallerException.class) public org.springframework.http.ResponseEntity<Map<String,List<EddieApiError>>> handleInstallerException(InstallerException exception)
-