Class RPCException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
eu.cloudnetservice.driver.network.rpc.exception.RPCException
- All Implemented Interfaces:
Serializable
A runtime exception thrown when anything went wrong during the execution of a rpc or rpc chain.
- Since:
- 4.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRPCException(@NonNull RPCChain chain, @NonNull Exception root) Constructs a new rpc exception instance.RPCException(@NonNull RPC rpc, @NonNull Exception root) Constructs a new rpc exception instance. -
Method Summary
Modifier and TypeMethodDescriptionFormats the given rpc entry, using theformatRPCmethod and prepends aatto make it look like an exception.Formats the given rpc into a better readable string, including the target class and method name as well as all arguments which were used for the target method call.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RPCException
Constructs a new rpc exception instance.- Parameters:
rpc- the rpc during which the execution happened.root- the exception which was thrown.- Throws:
NullPointerException- if either the given rpc or root exception is null.
-
RPCException
Constructs a new rpc exception instance.- Parameters:
chain- the rpc chain during which execution the execution happened.root- the exception which was thrown.- Throws:
NullPointerException- if either the given rpc chain or root exception is null.
-
-
Method Details
-
formatRPC
Formats the given rpc into a better readable string, including the target class and method name as well as all arguments which were used for the target method call.- Parameters:
rpc- the rpc chain during which the execution happened.- Returns:
- a formatted, human-readable string based on the given rpc.
- Throws:
NullPointerException- if the given rpc is null.
-
formatChainedRPCEntry
Formats the given rpc entry, using theformatRPCmethod and prepends aatto make it look like an exception. This is more for easier reading which rpc entries were joined on.- Parameters:
rpc- the next entry in the rpc chain to format.- Returns:
- a formatted, human-readable string based on the given rpc entry.
- Throws:
NullPointerException- if the given rpc entry is null.
-