Package com.perforce.p4java.common.base
Class P4JavaExceptions
java.lang.Object
com.perforce.p4java.common.base.P4JavaExceptions
- Since:
- 2/09/2016
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,R> Function<T, R> rethrowFunction(FunctionWithException<T, R> function) static voidthrowAccessExceptionIfConditionFails(boolean expression, String message, Object... args) If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessagestatic voidthrowConnectionException(String message, Object... args) static voidstatic voidthrowConnectionException(Throwable cause, String message, Object... args) static voidthrowConnectionExceptionIfConditionFails(boolean expression, String message, Object... args) If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessagestatic voidthrowIOException(String message, Object... args) static voidthrowIOException(Throwable cause) static voidthrowIOException(Throwable cause, String message, Object... args) static voidthrowIOExceptionIfConditionFails(boolean expression, String message, Object... args) static voidthrowOptionsException(String message, Object... args) static voidthrowOptionsException(Throwable cause) static voidthrowOptionsException(Throwable cause, String message, Object... args) static voidthrowOptionsExceptionIfConditionFails(boolean expression, String message, Object... args) If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessagestatic voidthrowP4JavaError(String message, Object... args) static voidthrowP4JavaError(Throwable cause, String message, Object... args) static voidthrowP4JavaErrorIfConditionFails(boolean expression, String message, Object... args) If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessagestatic voidthrowProtocolErrorIfConditionFails(boolean expression, String message, Object... args) If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessagestatic voidthrowRequestExceptionIfConditionFails(boolean expression, String message, Object... args) If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessagestatic voidthrowRequestExceptionIfConditionFails(boolean expression, String codeString, String message, Object... args) If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessagestatic voidthrowRequestExceptionIfPerforceServerVersionOldThanExpected(boolean expression, String message, Object... args)
-
Method Details
-
throwConnectionExceptionIfConditionFails
public static void throwConnectionExceptionIfConditionFails(boolean expression, String message, Object... args) throws ConnectionException If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessage- Parameters:
expression- expressionmessage- messageargs- args- Throws:
ConnectionException- on error
-
throwConnectionException
public static void throwConnectionException(String message, Object... args) throws ConnectionException - Throws:
ConnectionException
-
throwConnectionException
- 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 checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessage- Parameters:
expression- expressionmessage- messageargs- args- Throws:
ProtocolError- on error
-
throwP4JavaErrorIfConditionFails
public static void throwP4JavaErrorIfConditionFails(boolean expression, String message, Object... args) throws P4JavaError If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessage- Parameters:
expression- expressionmessage- messageargs- args- Throws:
P4JavaError- on error
-
throwP4JavaError
public static void throwP4JavaError(Throwable cause, String message, Object... args) throws P4JavaError - Throws:
P4JavaError
-
throwP4JavaError
- Throws:
P4JavaError
-
throwOptionsExceptionIfConditionFails
public static void throwOptionsExceptionIfConditionFails(boolean expression, String message, Object... args) throws OptionsException If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessage- Parameters:
expression- expressionmessage- messageargs- args- Throws:
OptionsException- on error
-
throwOptionsException
public static void throwOptionsException(Throwable cause, String message, Object... args) throws OptionsException - Throws:
OptionsException
-
throwOptionsException
- Throws:
OptionsException
-
throwOptionsException
- Throws:
OptionsException
-
throwRequestExceptionIfConditionFails
public static void throwRequestExceptionIfConditionFails(boolean expression, String codeString, String message, Object... args) throws RequestException If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessage- Parameters:
expression- expressioncodeString- codeStringmessage- messageargs- args- Throws:
RequestException- on error
-
throwRequestExceptionIfConditionFails
public static void throwRequestExceptionIfConditionFails(boolean expression, String message, Object... args) throws RequestException If the checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessage- Parameters:
expression- expressionmessage- messageargs- 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 checkexpressionfails; thenConnectionExceptionwill throw with given error messagemessage- Parameters:
expression- expressionmessage- messageargs- args- Throws:
AccessException- on error
-
throwIOException
- Throws:
IOException
-
throwIOException
public static void throwIOException(Throwable cause, String message, Object... args) throws IOException - Throws:
IOException
-
throwIOException
- Throws:
IOException
-
throwIOExceptionIfConditionFails
public static void throwIOExceptionIfConditionFails(boolean expression, String message, Object... args) throws IOException - Throws:
IOException
-
rethrowFunction
-