org.springframework.messaging.support

## Class ErrorMessage

- java.lang.Object
- - org.springframework.messaging.support.GenericMessage<Throwable>
  - - org.springframework.messaging.support.ErrorMessage

- All Implemented Interfaces:
    Serializable, Message<Throwable>

      public class ErrorMessage
      extends GenericMessage<Throwable>

  A `GenericMessage` with a `Throwable` payload.
  Since:
    4.0
  Author:
    Mark Fisher, Oleg Zhurakousky
  See Also:
    `MessageBuilder`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ErrorMessage(Throwable payload)` Create a new message with the given payload.
    `ErrorMessage(Throwable payload, Map<String,Object> headers)` Create a new message with the given payload and headers.

  - ### Method Summary

    - ### Methods inherited from class org.springframework.messaging.support.GenericMessage

      `equals, getHeaders, getPayload, hashCode, toString`

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

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

- - ### Constructor Detail

    - #### ErrorMessage

          public ErrorMessage(Throwable payload)

      Create a new message with the given payload.
      Parameters:
        `payload` - the message payload, never `null`

    - #### ErrorMessage

          public ErrorMessage(Throwable payload,
                              Map<String,Object> headers)

      Create a new message with the given payload and headers.
      Parameters:
        `payload` - the message payload, never `null`
        `headers` - message headers