Skip to main content

Find exception handlers

io.moderne.prethink.calm.FindExceptionHandlers

Capture @ControllerAdvice and controller-local @ExceptionHandler methods so that OpenAPI 3.0.3 specs include non-2xx response branches. Emits one row per (scope, exception type, status) triple.

Recipe source

This recipe is only available to users of Moderne.

This recipe is available under the Moderne Proprietary License.

Used by

This recipe is used as part of the following composite recipes:

Usage

This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI.

You will need to have configured the Moderne CLI on your machine before you can run the following command.

shell
mod run . --recipe FindExceptionHandlers

If the recipe is not available locally, then you can install it using:

mod config recipes jar install io.moderne.recipe:rewrite-prethink:0.6.0

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Exception handlers

io.moderne.prethink.table.ExceptionHandlers

Spring @ExceptionHandler and @ControllerAdvice bindings: exception type -> HTTP status -> response body FQN. Used to complete the 'responses' section of an OpenAPI spec with non-2xx branches.

Column NameDescription
Source pathThe path to the source file containing the handler.
Scope class FQNFully qualified name of the @ControllerAdvice class OR the controller class hosting the local handler.
Scope kind'advice' when the handler lives on a @ControllerAdvice class, 'controller' for controller-local handlers.
Base packagesComma-separated basePackages from @ControllerAdvice narrowing scope, else null.
Exception FQNFully qualified name of the exception type handled by this method.
Handler methodThe handler method name.
StatusHTTP status code returned (e.g. 400, 500), or null when it could not be resolved.
Status sourceWhere the status came from: '@ResponseStatus', 'ResponseEntity.status', or 'unresolved'.
Response body FQNFully qualified name of the response body DTO for this handler, or null if no body.