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

public class RPCException extends RuntimeException
A runtime exception thrown when anything went wrong during the execution of a rpc or rpc chain.
Since:
4.0
See Also:
  • Constructor Details

    • RPCException

      public RPCException(@NonNull @NonNull RPC rpc, @NonNull @NonNull Exception root)
      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

      public RPCException(@NonNull @NonNull RPCChain chain, @NonNull @NonNull Exception root)
      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

      @NonNull protected static @NonNull String formatRPC(@NonNull @NonNull RPC rpc)
      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

      @NonNull protected static @NonNull String formatChainedRPCEntry(@NonNull @NonNull RPC rpc)
      Formats the given rpc entry, using the formatRPC method and prepends a at to 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.