Spring Framework
  1. Spring Framework
  2. SPR-8124

@ExceptionHandler doesn't handle exceptions from other controllers

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      The fact that a method annotated with @ExceptionHandler can only handle exceptions from the same controller is a restrictive issue. The better behavior would be if the annotated method would be able to handle all exceptions of that particular type, regardless of their source.

        Issue Links

          Activity

          Hide
          Rossen Stoyanchev added a comment -

          I am resolving as duplicate of SPR-7278. See the discussion under that issue. Note that the provided extension hook in the new ExceptionHandlerExceptionResolver that allows you to contribute @ExceptionHandler methods to all controllers. A simpler approach however would be to have a HandlerExceptionResolver (similar to DefaultHandlerExceptionResolver).

          Show
          Rossen Stoyanchev added a comment - I am resolving as duplicate of SPR-7278 . See the discussion under that issue. Note that the provided extension hook in the new ExceptionHandlerExceptionResolver that allows you to contribute @ExceptionHandler methods to all controllers. A simpler approach however would be to have a HandlerExceptionResolver (similar to DefaultHandlerExceptionResolver).

            People

            • Assignee:
              Rossen Stoyanchev
              Reporter:
              Eugen Paraschiv
              Last updater:
              Trevor Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 44 weeks, 4 days ago