Class BERNodeError

java.lang.Object
com.snmp4j.smi.ber.BERNode
com.snmp4j.smi.ber.BERNodeError

public class BERNodeError extends BERNode
A BER node representing a parse error: a deviation from the expected SNMP message structure.
Since:
2.0.0
Author:
Frank Fock
  • Constructor Details

    • BERNodeError

      public BERNodeError(int position, String errorMessage, byte[] offendingBytes, List<Integer> expectedTags)
      Creates a BER node representing a parse error.
      Parameters:
      position - byte offset in the raw message where the error was detected
      errorMessage - human-readable description of the error
      offendingBytes - raw bytes at the error position (may be empty or null)
      expectedTags - BER tag values that were expected at this position (decimal)
  • Method Details

    • getErrorMessage

      public String getErrorMessage()
      Gets the human-readable error message.
      Returns:
      the error message
    • getOffendingBytes

      public byte[] getOffendingBytes()
      Gets the raw bytes at the error position.
      Returns:
      the raw bytes at the error position.
    • getErrorExpectedTags

      public List<Integer> getErrorExpectedTags()
      Gets the BER tag values expected at this position.
      Returns:
      the BER tag values that were expected at this position (decimal)
    • toString

      public String toString()
      Description copied from class: BERNode
      Returns a multi-line string representation of this BER node.
      Overrides:
      toString in class BERNode
      Returns:
      a string representation of this BER node.