nxt.peer

## Class NetworkMessage.ErrorMessage

- java.lang.Object
- - nxt.peer.NetworkMessage
  - - nxt.peer.NetworkMessage.ErrorMessage

- Enclosing class:
    NetworkMessage

      public static class NetworkMessage.ErrorMessage
      extends NetworkMessage

  The Error message is returned when a error is detected while processing a request. No error is returned for messages that do not have a response. The message identifier is obtained from the request message.
  - Message identifier (long)
  - Error severity (boolean)
  - Error name (string)
  - Error message (string)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class nxt.peer.NetworkMessage

      `NetworkMessage.AddPeersMessage, NetworkMessage.BlockchainStateMessage, NetworkMessage.BlockIdsMessage, NetworkMessage.BlockInventoryMessage, NetworkMessage.BlocksMessage, NetworkMessage.BundlerRateMessage, NetworkMessage.CumulativeDifficultyMessage, NetworkMessage.ErrorMessage, NetworkMessage.GetBlockMessage, NetworkMessage.GetCumulativeDifficultyMessage, NetworkMessage.GetInfoMessage, NetworkMessage.GetMilestoneBlockIdsMessage, NetworkMessage.GetNextBlockIdsMessage, NetworkMessage.GetNextBlocksMessage, NetworkMessage.GetPeersMessage, NetworkMessage.GetTransactionsMessage, NetworkMessage.GetUnconfirmedTransactionsMessage, NetworkMessage.MilestoneBlockIdsMessage, NetworkMessage.TransactionsInventoryMessage, NetworkMessage.TransactionsMessage`

  - ### Field Summary

    - ### Fields inherited from class nxt.peer.NetworkMessage

      `MAX_ARRAY_LENGTH, MAX_LIST_SIZE, messageId`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ErrorMessage(long messageId, boolean severeError, java.lang.String errorName, java.lang.String errorMessage)` Construct an Error message

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected NetworkMessage` | `constructMessage(java.nio.ByteBuffer bytes)` Construct the message from the message bytes
    `java.lang.String` | `getErrorMessage()` Get the error message
    `java.lang.String` | `getErrorName()` Get the error name
    `boolean` | `isSevereError()` Check if this is a severe error

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

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

- - ### Constructor Detail

    - #### ErrorMessage

          public ErrorMessage(long messageId,
                              boolean severeError,
                              java.lang.String errorName,
                              java.lang.String errorMessage)

      Construct an Error message
      Parameters:
        `messageId` - Message identifier
        `severeError` - TRUE if this is a severe error
        `errorName` - Error name
        `errorMessage` - Error message

  - ### Method Detail

    - #### constructMessage

          protected NetworkMessage constructMessage(java.nio.ByteBuffer bytes)
                                             throws java.nio.BufferOverflowException,
                                                    java.nio.BufferUnderflowException,
                                                    nxt.peer.NetworkException

      Construct the message from the message bytes
      Overrides:
        `constructMessage` in class `NetworkMessage`
      Parameters:
        `bytes` - Message bytes following the message name
      Returns:
        Message
      Throws:
        `java.nio.BufferOverflowException` - Message buffer is too small
        `java.nio.BufferUnderflowException` - Message is too short
        `NetworkException` - Message is not valid

    - #### isSevereError

          public boolean isSevereError()

      Check if this is a severe error
      Returns:
        TRUE if this is a severe error

    - #### getErrorName

          public java.lang.String getErrorName()

      Get the error name
      Returns:
        Error name

    - #### getErrorMessage

          public java.lang.String getErrorMessage()

      Get the error message
      Returns:
        Error Message