Package org.springframework.web.server

# Class ServerWebInputException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.web.ErrorResponseException
org.springframework.web.server.ResponseStatusException
org.springframework.web.server.ServerWebInputException

All Implemented Interfaces:
  `Serializable`, `ErrorResponse`

Direct Known Subclasses:
  `MissingRequestValueException`, `UnsatisfiedRequestParameterException`, `WebExchangeBindException`

public class ServerWebInputException extends ResponseStatusException
Exception for errors that fit response status 400 (bad request) for use in Spring Web applications. The exception provides additional fields (for example, an optional `MethodParameter` if related to the error).

Since:
  5.0
Author:
  Rossen Stoyanchev
See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.springframework.web.ErrorResponse

`ErrorResponse.Builder, ErrorResponse.Interceptor`

## Constructor Summary

Constructors
Modifier
Constructor
Description
``
`ServerWebInputException(String reason)`
Constructor with an explanation only.
``
`ServerWebInputException(String reason, org.springframework.core.MethodParameter parameter)`
Constructor for a 400 error linked to a specific `MethodParameter`.
``
`ServerWebInputException(String reason, org.springframework.core.MethodParameter parameter, Throwable cause)`
Constructor for a 400 error with a root cause.
`protected`
`ServerWebInputException(String reason, org.springframework.core.MethodParameter parameter, Throwable cause, String messageDetailCode, Object[] messageDetailArguments)`
Constructor with a message code and arguments for resolving the error "detail" via `MessageSource`.

## Method Summary

Modifier and Type
Method
Description
`org.springframework.core.MethodParameter`
`getMethodParameter()`
Return the `MethodParameter` associated with this error, if any.

### Methods inherited from class org.springframework.web.server.ResponseStatusException

`getHeaders, getMessage, getReason, getResponseHeaders, updateAndGetBody`

### Methods inherited from class org.springframework.web.ErrorResponseException

`getBody, getDetailMessageArguments, getDetailMessageCode, getStatusCode, setDetail, setInstance, setTitle, setType`

### Methods inherited from class org.springframework.core.NestedRuntimeException

`contains, getMostSpecificCause, getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.web.ErrorResponse

`getDetailMessageArguments, getTitleMessageCode, getTypeMessageCode`

## Constructor Details

### ServerWebInputException

public ServerWebInputException(String reason)
Constructor with an explanation only.

### ServerWebInputException

public ServerWebInputException(String reason, @Nullable org.springframework.core.MethodParameter parameter)
Constructor for a 400 error linked to a specific `MethodParameter`.

### ServerWebInputException

public ServerWebInputException(String reason, @Nullable org.springframework.core.MethodParameter parameter, @Nullable Throwable cause)
Constructor for a 400 error with a root cause.

### ServerWebInputException

protected ServerWebInputException(String reason, @Nullable org.springframework.core.MethodParameter parameter, @Nullable Throwable cause, @Nullable String messageDetailCode, @Nullable Object[] messageDetailArguments)
Constructor with a message code and arguments for resolving the error "detail" via `MessageSource`.

Since:
  6.0

## Method Details

### getMethodParameter

@Nullable public org.springframework.core.MethodParameter getMethodParameter()
Return the `MethodParameter` associated with this error, if any.