java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jnetpcap.PcapException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
PcapActivatedException
,PcapVersionException
Checked Pcap errors, warnings and exceptions.
- Author:
- Sly Technologies, repos@slytechs.com
- See Also:
-
Constructor Summary
ConstructorDescriptionPcapException
(int pcapErrorCode) Instantiates a new pcap exception.PcapException
(int pcapErrorCode, String message) Instantiates a new pcap exception.PcapException
(String message) Instantiates a new pcap exception.PcapException
(PcapCode pcapErrorCode) Instantiates a new pcap exception. -
Method Summary
Modifier and TypeMethodDescriptionint
getCode()
Gets the code.static void
throwIfNotOk
(int code) Throw if not ok.static void
throwIfNotOk
(int code, Supplier<String> message) Throw if not ok.static void
throwIfNotOk
(PcapCode code, Supplier<String> message) Throw if not ok.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
PcapException
public PcapException(int pcapErrorCode) Instantiates a new pcap exception.- Parameters:
pcapErrorCode
- the pcap error code
-
PcapException
Instantiates a new pcap exception.- Parameters:
pcapErrorCode
- the pcap error codemessage
- the message
-
PcapException
Instantiates a new pcap exception.- Parameters:
pcapErrorCode
- the pcap error code
-
PcapException
Instantiates a new pcap exception.- Parameters:
message
- the message
-
-
Method Details
-
throwIfNotOk
Throw if not ok.- Parameters:
code
- the code- Throws:
PcapException
- the pcap exception
-
throwIfNotOk
Throw if not ok.- Parameters:
code
- the codemessage
- the message- Throws:
PcapException
- the pcap exception
-
throwIfNotOk
Throw if not ok.- Parameters:
code
- the codemessage
- the message- Throws:
PcapException
- the pcap exception
-
getCode
public int getCode()Gets the code.- Returns:
- the code
-