com.h3c.util.pkt

## Class ProtocolException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - com.h3c.util.pkt.ProtocolException

- All Implemented Interfaces:
    Serializable

      public class ProtocolException
      extends RuntimeException

  Exception thrown when a protocol's data violates some constraint or there is a encoder error (i.e. buffer overrun).
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProtocolException(Exception e, Protocol p)` Constructs a new runtime exception for the specified protocol.
    `ProtocolException(Exception e, Protocol p, PacketReader r)` Constructs a new runtime exception for the specified protocol.
    `ProtocolException(ProtocolException e, Packet pkt)` Constructs a new runtime exception for the specified packet and protocol.
    `ProtocolException(String m)` Constructs a new runtime exception with the specified detail message.
    `ProtocolException(String m, Protocol p, PacketReader r)` Constructs a new runtime exception for the specified protocol.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `decodeDebugString()` Returns the decode debug string associated with this exception or "".
    `Packet` | `packet()` Returns the packet associated with this exception or null.
    `Protocol` | `protocol()` Returns the protocol associated with this exception or null.
    `PacketReader` | `reader()` Returns the packet reader associated with this exception or null.
    `Throwable` | `rootCause()` Returns the root cause of this protocol exception.

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

- - ### Constructor Detail

    - #### ProtocolException

          public ProtocolException(String m)

      Constructs a new runtime exception with the specified detail message.
      Parameters:
        `m` - the detail message

    - #### ProtocolException

          public ProtocolException(Exception e,
                           Protocol p)

      Constructs a new runtime exception for the specified protocol.
      Parameters:
        `e` - original exception
        `p` - the protocol associated with this exception

    - #### ProtocolException

          public ProtocolException(String m,
                           Protocol p,
                           PacketReader r)

      Constructs a new runtime exception for the specified protocol.
      Parameters:
        `m` - the detail message
        `p` - the protocol associated with this exception
        `r` - the reader associated with this exception

    - #### ProtocolException

          public ProtocolException(Exception e,
                           Protocol p,
                           PacketReader r)

      Constructs a new runtime exception for the specified protocol.
      Parameters:
        `e` - original exception
        `p` - the protocol associated with this exception
        `r` - the reader associated with this exception

    - #### ProtocolException

          public ProtocolException(ProtocolException e,
                           Packet pkt)

      Constructs a new runtime exception for the specified packet and protocol.
      Parameters:
        `e` - original protocol exception
        `pkt` - the packet associated with this exception

  - ### Method Detail

    - #### reader

          public PacketReader reader()

      Returns the packet reader associated with this exception or null.
      Returns:
        the reader associated with this exception

    - #### protocol

          public Protocol protocol()

      Returns the protocol associated with this exception or null.
      Returns:
        the protocol associated with this exception

    - #### packet

          public Packet packet()

      Returns the packet associated with this exception or null.
      Returns:
        the packet associated with this exception

    - #### rootCause

          public Throwable rootCause()

      Returns the root cause of this protocol exception.
      Returns:
        the root cause of this protocol exception

    - #### decodeDebugString

          public String decodeDebugString()

      Returns the decode debug string associated with this exception or "".
      Returns:
        the decode debug string

Copyright © 2014. All Rights Reserved.