Class GlobalExceptionHandler

java.lang.Object
com.bluebell.greenhouse.planter.controllers.advice.GlobalExceptionHandler

@RestControllerAdvice public class GlobalExceptionHandler extends Object
Handles the exceptions thrown by the application.
Version:
3.0.6
Author:
Stephen Prizio
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<ApiError>
    handleBadRequest(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles bad requests.
    org.springframework.http.ResponseEntity<ApiError>
    handleConflict(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles conflicts.
    org.springframework.http.ResponseEntity<ApiError>
    handleConstraintViolation(jakarta.validation.ConstraintViolationException exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles bean validation failures outside request-body binding.
    org.springframework.http.ResponseEntity<ApiError>
    handleForbidden(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles forbidden errors.
    org.springframework.http.ResponseEntity<ApiError>
    handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles invalid request bodies.
    org.springframework.http.ResponseEntity<ApiError>
    handleNotFound(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles not found errors.
    org.springframework.http.ResponseEntity<ApiError>
    handleServerError(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles server-side errors.
    org.springframework.http.ResponseEntity<ApiError>
    handleServiceUnavailable(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles services unavailable.
    org.springframework.http.ResponseEntity<ApiError>
    handleUnauthorized(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles unauthorized errors.
    org.springframework.http.ResponseEntity<ApiError>
    handleUnhandled(Exception exception, jakarta.servlet.http.HttpServletRequest request)
    Method that handles all other errors.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GlobalExceptionHandler

      public GlobalExceptionHandler()
  • Method Details