spring-framework / org.springframework.web.server / ServerErrorException

ServerErrorException

open class ServerErrorException : ResponseStatusException

Exception for errors that fit response status 500 (bad request) for use in Spring Web applications. The exception provides additional fields (e.g. an optional MethodParameter if related to the error).

Author
Rossen Stoyanchev

Since
5.0

Constructors

<init>

ServerErrorException(reason: String)

Constructor with an explanation only.

ServerErrorException(reason: String, parameter: MethodParameter)

Constructor for a 500 error linked to a specific MethodParameter.

ServerErrorException(reason: String, parameter: MethodParameter, cause: Throwable)

Constructor for a 500 error with a root cause.

Functions

getMethodParameter

open fun getMethodParameter(): MethodParameter

Return the MethodParameter associated with this error, if any.