Package io.micronaut.http.annotation
Annotation Interface Error
@Documented
@Retention(RUNTIME)
@Target(METHOD)
@HttpMethodMapping
@Inherited
public @interface Error
Annotation that can be applied to method to map it to an error route.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Whether the error handler should be registered as a global error handler or just locally to the declaringController
.
-
Element Details
-
value
- Returns:
- The exception to map to
- Default:
- java.lang.Throwable.class
-
exception
- Returns:
- The exception to map to
- Default:
- java.lang.Throwable.class
-
status
HttpStatus status- Returns:
- The
HttpStatus
code to map
- Default:
- INTERNAL_SERVER_ERROR
-
global
boolean globalWhether the error handler should be registered as a global error handler or just locally to the declaringController
.- Returns:
- True if it should be global
- Default:
- false
-