org.springframework.web.server

Class ServerWebInputException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    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 (e.g. an optional MethodParameter if related to the error).
    Since:
    5.0
    Author:
    Rossen Stoyanchev
    See Also:
    Serialized Form
    • Constructor Detail

      • ServerWebInputException

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

        public ServerWebInputException(java.lang.String reason,
                                       @Nullable
                                       MethodParameter parameter)
        Constructor for a 400 error linked to a specific MethodParameter.
      • ServerWebInputException

        public ServerWebInputException(java.lang.String reason,
                                       @Nullable
                                       MethodParameter parameter,
                                       @Nullable
                                       java.lang.Throwable cause)
        Constructor for a 400 error with a root cause.
    • Method Detail

      • getMethodParameter

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