Class Error
java.lang.Object
org.springframework.boot.web.error.Error
- All Implemented Interfaces:
org.springframework.context.MessageSourceResolvable
public final class Error
extends Object
implements org.springframework.context.MessageSourceResolvable
A wrapper class for
MessageSourceResolvable errors that is safe for JSON
serialization.- Since:
- 3.5.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanObject @Nullable []org.springframework.context.MessageSourceResolvablegetCause()Return the original cause of the error.String @Nullable []getCodes()@Nullable StringinthashCode()toString()static List<org.springframework.context.MessageSourceResolvable> wrapIfNecessary(List<? extends org.springframework.context.MessageSourceResolvable> errors) Wrap the given errors, if necessary, such that they are suitable for serialization to JSON.
-
Method Details
-
getCodes
- Specified by:
getCodesin interfaceorg.springframework.context.MessageSourceResolvable
-
getArguments
- Specified by:
getArgumentsin interfaceorg.springframework.context.MessageSourceResolvable
-
getDefaultMessage
- Specified by:
getDefaultMessagein interfaceorg.springframework.context.MessageSourceResolvable
-
getCause
public org.springframework.context.MessageSourceResolvable getCause()Return the original cause of the error.- Returns:
- the error cause
-
equals
-
hashCode
-
toString
-
wrapIfNecessary
public static List<org.springframework.context.MessageSourceResolvable> wrapIfNecessary(List<? extends org.springframework.context.MessageSourceResolvable> errors) Wrap the given errors, if necessary, such that they are suitable for serialization to JSON.MessageSourceResolvableimplementations that are known to be suitable are not wrapped.- Parameters:
errors- the errors to wrap- Returns:
- a new Error list
- Since:
- 3.5.4
-