Annotation Type ServerExceptionMapper
-
@Retention(RUNTIME) @Target(METHOD) public @interface ServerExceptionMapper
When used on a method, then an implementation ofExceptionMapperis generated that calls the annotated method with the proper arguments.When the annotation is placed on a method that is not a JAX-RS Resource class, the method handles exceptions in global fashion (as do regular JAX-RS
ExceptionMapperimplementations). However, when it is placed on a method of a JAX-RS Resource class, the method is only used to handle exceptions originating from that JAX-RS Resource class. Methods in a JAX-RS class annotated with this annotation will be used first when determining how to handle a thrown exception. This means that these methods take precedence over the globalExceptionMapperclasses.In addition to the exception being handled, an annotated method can also declare any of the following parameters (in any order):
ContainerRequestContextUriInfoHttpHeadersRequestResourceInfoSimpleResourceInfo
valueis not set, then the handled Exception type is deduced by the Exception type used in the method parameters (there must be exactly one Exception type in this case).The return type of the method must be either be of type
Response,Uni<Response>,RestResponseorUni<RestResponse>.