Module org.jnetpcap
Package org.jnetpcap

Class PcapException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PcapActivatedException, PcapVersionException

public class PcapException extends Exception
Checked Pcap errors, warnings and exceptions.
Author:
Sly Technologies, repos@slytechs.com
See Also:
  • Constructor Details

    • PcapException

      public PcapException(int pcapErrorCode)
      Instantiates a new pcap exception.
      Parameters:
      pcapErrorCode - the pcap error code
    • PcapException

      public PcapException(int pcapErrorCode, String message)
      Instantiates a new pcap exception.
      Parameters:
      pcapErrorCode - the pcap error code
      message - the message
    • PcapException

      public PcapException(PcapCode pcapErrorCode)
      Instantiates a new pcap exception.
      Parameters:
      pcapErrorCode - the pcap error code
    • PcapException

      public PcapException(String message)
      Instantiates a new pcap exception.
      Parameters:
      message - the message
  • Method Details

    • throwIfNotOk

      public static void throwIfNotOk(int code) throws PcapException
      Throw if not ok.
      Parameters:
      code - the code
      Throws:
      PcapException - the pcap exception
    • throwIfNotOk

      public static void throwIfNotOk(int code, Supplier<String> message) throws PcapException
      Throw if not ok.
      Parameters:
      code - the code
      message - the message
      Throws:
      PcapException - the pcap exception
    • throwIfNotOk

      public static void throwIfNotOk(PcapCode code, Supplier<String> message) throws PcapException
      Throw if not ok.
      Parameters:
      code - the code
      message - the message
      Throws:
      PcapException - the pcap exception
    • getCode

      public int getCode()
      Gets the code.
      Returns:
      the code