Class P4JavaExceptions

java.lang.Object
com.perforce.p4java.common.base.P4JavaExceptions

public final class P4JavaExceptions extends Object
Since:
2/09/2016
  • Method Details

    • throwConnectionExceptionIfConditionFails

      public static void throwConnectionExceptionIfConditionFails(boolean expression, String message, Object... args) throws ConnectionException
      If the check expression fails; then ConnectionException will throw with given error message message
      Parameters:
      expression - expression
      message - message
      args - args
      Throws:
      ConnectionException - on error
    • throwConnectionException

      public static void throwConnectionException(String message, Object... args) throws ConnectionException
      Throws:
      ConnectionException
    • throwConnectionException

      public static void throwConnectionException(Throwable cause) throws ConnectionException
      Throws:
      ConnectionException
    • throwConnectionException

      public static void throwConnectionException(Throwable cause, String message, Object... args) throws ConnectionException
      Throws:
      ConnectionException
    • throwProtocolErrorIfConditionFails

      public static void throwProtocolErrorIfConditionFails(boolean expression, String message, Object... args) throws ProtocolError
      If the check expression fails; then ConnectionException will throw with given error message message
      Parameters:
      expression - expression
      message - message
      args - args
      Throws:
      ProtocolError - on error
    • throwP4JavaErrorIfConditionFails

      public static void throwP4JavaErrorIfConditionFails(boolean expression, String message, Object... args) throws P4JavaError
      If the check expression fails; then ConnectionException will throw with given error message message
      Parameters:
      expression - expression
      message - message
      args - args
      Throws:
      P4JavaError - on error
    • throwP4JavaError

      public static void throwP4JavaError(Throwable cause, String message, Object... args) throws P4JavaError
      Throws:
      P4JavaError
    • throwP4JavaError

      public static void throwP4JavaError(String message, Object... args) throws P4JavaError
      Throws:
      P4JavaError
    • throwOptionsExceptionIfConditionFails

      public static void throwOptionsExceptionIfConditionFails(boolean expression, String message, Object... args) throws OptionsException
      If the check expression fails; then ConnectionException will throw with given error message message
      Parameters:
      expression - expression
      message - message
      args - args
      Throws:
      OptionsException - on error
    • throwOptionsException

      public static void throwOptionsException(Throwable cause, String message, Object... args) throws OptionsException
      Throws:
      OptionsException
    • throwOptionsException

      public static void throwOptionsException(Throwable cause) throws OptionsException
      Throws:
      OptionsException
    • throwOptionsException

      public static void throwOptionsException(String message, Object... args) throws OptionsException
      Throws:
      OptionsException
    • throwRequestExceptionIfConditionFails

      public static void throwRequestExceptionIfConditionFails(boolean expression, String codeString, String message, Object... args) throws RequestException
      If the check expression fails; then ConnectionException will throw with given error message message
      Parameters:
      expression - expression
      codeString - codeString
      message - message
      args - args
      Throws:
      RequestException - on error
    • throwRequestExceptionIfConditionFails

      public static void throwRequestExceptionIfConditionFails(boolean expression, String message, Object... args) throws RequestException
      If the check expression fails; then ConnectionException will throw with given error message message
      Parameters:
      expression - expression
      message - message
      args - args
      Throws:
      RequestException - on error
    • throwRequestExceptionIfPerforceServerVersionOldThanExpected

      public static void throwRequestExceptionIfPerforceServerVersionOldThanExpected(boolean expression, String message, Object... args) throws RequestException
      Throws:
      RequestException
    • throwAccessExceptionIfConditionFails

      public static void throwAccessExceptionIfConditionFails(boolean expression, String message, Object... args) throws AccessException
      If the check expression fails; then ConnectionException will throw with given error message message
      Parameters:
      expression - expression
      message - message
      args - args
      Throws:
      AccessException - on error
    • throwIOException

      public static void throwIOException(Throwable cause) throws IOException
      Throws:
      IOException
    • throwIOException

      public static void throwIOException(Throwable cause, String message, Object... args) throws IOException
      Throws:
      IOException
    • throwIOException

      public static void throwIOException(String message, Object... args) throws IOException
      Throws:
      IOException
    • throwIOExceptionIfConditionFails

      public static void throwIOExceptionIfConditionFails(boolean expression, String message, Object... args) throws IOException
      Throws:
      IOException
    • rethrowFunction

      public static <T, R> Function<T,R> rethrowFunction(FunctionWithException<T,R> function)