Annotation Type 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
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<? extends java.lang.Throwable> exception  
      boolean global
      Whether the error handler should be registered as a global error handler or just locally to the declaring Controller.
      HttpStatus status  
      java.lang.Class<? extends java.lang.Throwable> value  
    • Element Detail

      • value

        @AliasFor(member="exception")
        java.lang.Class<? extends java.lang.Throwable> value
        Returns:
        The exception to map to
        Default:
        java.lang.Throwable.class
      • exception

        @AliasFor(member="value")
        java.lang.Class<? extends java.lang.Throwable> exception
        Returns:
        The exception to map to
        Default:
        java.lang.Throwable.class
      • status

        HttpStatus status
        Returns:
        The HttpStatus code to map
        Default:
        io.micronaut.http.HttpStatus.INTERNAL_SERVER_ERROR
      • global

        boolean global
        Whether the error handler should be registered as a global error handler or just locally to the declaring Controller.
        Returns:
        True if it should be global
        Default:
        false