Class DefaultErrorAttributes

  • All Implemented Interfaces:
    ErrorAttributes

    public class DefaultErrorAttributes
    extends Object
    implements ErrorAttributes
    Default implementation of ErrorAttributes. Provides the following attributes when possible:
    • timestamp - The time that the errors were extracted
    • status - The status code
    • error - The error reason
    • exception - The class name of the root exception (if configured)
    • message - The exception message
    • errors - Any ObjectErrors from a BindingResult exception
    • trace - The exception stack trace
    • path - The URL path when the exception was raised
    Since:
    2.0.0
    See Also:
    ErrorAttributes
    • Method Detail

      • getErrorAttributes

        public Map<String,​ObjectgetErrorAttributes​(org.springframework.web.reactive.function.server.ServerRequest request,
                                                           boolean includeStackTrace)
        Description copied from interface: ErrorAttributes
        Return a Map of the error attributes. The map can be used as the model of an error page, or returned as a ServerResponse body.
        Specified by:
        getErrorAttributes in interface ErrorAttributes
        Parameters:
        request - the source request
        includeStackTrace - if stack trace elements should be included
        Returns:
        a map of error attributes
      • getError

        public Throwable getError​(org.springframework.web.reactive.function.server.ServerRequest request)
        Description copied from interface: ErrorAttributes
        Return the underlying cause of the error or null if the error cannot be extracted.
        Specified by:
        getError in interface ErrorAttributes
        Parameters:
        request - the source ServerRequest
        Returns:
        the Exception that caused the error or null