spring-framework / org.springframework.web.bind.annotation / ExceptionHandler / <init>

<init>

ExceptionHandler(vararg value: KClass<out Throwable>)

Annotation for handling exceptions in specific handler classes and/or handler methods.

Handler methods which are annotated with this annotation are allowed to have very flexible signatures. They may have parameters of the following types, in arbitrary order:

The following return types are supported for handler methods:

In Servlet environments, you can combine the ExceptionHandler annotation with ResponseStatus, to define the response status for the HTTP response.

Author
Arjen Poutsma

Author
Juergen Hoeller

Since
3.0

See Also
org.springframework.web.context.request.WebRequest