Package com.perforce.p4java.common.base
Class P4JavaExceptions
- java.lang.Object
-
- com.perforce.p4java.common.base.P4JavaExceptions
-
public final class P4JavaExceptions extends java.lang.Object
- Since:
- 2/09/2016
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,R>
Function<T,R>rethrowFunction(FunctionWithException<T,R> function)
static void
throwAccessExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args)
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
static void
throwConnectionException(java.lang.String message, java.lang.Object... args)
static void
throwConnectionException(java.lang.Throwable cause)
static void
throwConnectionException(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)
static void
throwConnectionExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args)
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
static void
throwIOException(java.lang.String message, java.lang.Object... args)
static void
throwIOException(java.lang.Throwable cause)
static void
throwIOException(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)
static void
throwIOExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args)
static void
throwOptionsException(java.lang.String message, java.lang.Object... args)
static void
throwOptionsException(java.lang.Throwable cause)
static void
throwOptionsException(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)
static void
throwOptionsExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args)
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
static void
throwP4JavaError(java.lang.String message, java.lang.Object... args)
static void
throwP4JavaError(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)
static void
throwP4JavaErrorIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args)
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
static void
throwProtocolErrorIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args)
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
static void
throwRequestExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args)
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
static void
throwRequestExceptionIfConditionFails(boolean expression, java.lang.String codeString, java.lang.String message, java.lang.Object... args)
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
static void
throwRequestExceptionIfPerforceServerVersionOldThanExpected(boolean expression, java.lang.String message, java.lang.Object... args)
-
-
-
Method Detail
-
throwConnectionExceptionIfConditionFails
public static void throwConnectionExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args) throws ConnectionException
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
- Parameters:
expression
- expressionmessage
- messageargs
- args- Throws:
ConnectionException
- on error
-
throwConnectionException
public static void throwConnectionException(java.lang.String message, java.lang.Object... args) throws ConnectionException
- Throws:
ConnectionException
-
throwConnectionException
public static void throwConnectionException(java.lang.Throwable cause) throws ConnectionException
- Throws:
ConnectionException
-
throwConnectionException
public static void throwConnectionException(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args) throws ConnectionException
- Throws:
ConnectionException
-
throwProtocolErrorIfConditionFails
public static void throwProtocolErrorIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args) throws ProtocolError
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
- Parameters:
expression
- expressionmessage
- messageargs
- args- Throws:
ProtocolError
- on error
-
throwP4JavaErrorIfConditionFails
public static void throwP4JavaErrorIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args) throws P4JavaError
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
- Parameters:
expression
- expressionmessage
- messageargs
- args- Throws:
P4JavaError
- on error
-
throwP4JavaError
public static void throwP4JavaError(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args) throws P4JavaError
- Throws:
P4JavaError
-
throwP4JavaError
public static void throwP4JavaError(java.lang.String message, java.lang.Object... args) throws P4JavaError
- Throws:
P4JavaError
-
throwOptionsExceptionIfConditionFails
public static void throwOptionsExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args) throws OptionsException
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
- Parameters:
expression
- expressionmessage
- messageargs
- args- Throws:
OptionsException
- on error
-
throwOptionsException
public static void throwOptionsException(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args) throws OptionsException
- Throws:
OptionsException
-
throwOptionsException
public static void throwOptionsException(java.lang.Throwable cause) throws OptionsException
- Throws:
OptionsException
-
throwOptionsException
public static void throwOptionsException(java.lang.String message, java.lang.Object... args) throws OptionsException
- Throws:
OptionsException
-
throwRequestExceptionIfConditionFails
public static void throwRequestExceptionIfConditionFails(boolean expression, java.lang.String codeString, java.lang.String message, java.lang.Object... args) throws RequestException
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
- Parameters:
expression
- expressioncodeString
- codeStringmessage
- messageargs
- args- Throws:
RequestException
- on error
-
throwRequestExceptionIfConditionFails
public static void throwRequestExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args) throws RequestException
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
- Parameters:
expression
- expressionmessage
- messageargs
- args- Throws:
RequestException
- on error
-
throwRequestExceptionIfPerforceServerVersionOldThanExpected
public static void throwRequestExceptionIfPerforceServerVersionOldThanExpected(boolean expression, java.lang.String message, java.lang.Object... args) throws RequestException
- Throws:
RequestException
-
throwAccessExceptionIfConditionFails
public static void throwAccessExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args) throws AccessException
If the checkexpression
fails; thenConnectionException
will throw with given error messagemessage
- Parameters:
expression
- expressionmessage
- messageargs
- args- Throws:
AccessException
- on error
-
throwIOException
public static void throwIOException(java.lang.Throwable cause) throws java.io.IOException
- Throws:
java.io.IOException
-
throwIOException
public static void throwIOException(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args) throws java.io.IOException
- Throws:
java.io.IOException
-
throwIOException
public static void throwIOException(java.lang.String message, java.lang.Object... args) throws java.io.IOException
- Throws:
java.io.IOException
-
throwIOExceptionIfConditionFails
public static void throwIOExceptionIfConditionFails(boolean expression, java.lang.String message, java.lang.Object... args) throws java.io.IOException
- Throws:
java.io.IOException
-
rethrowFunction
public static <T,R> Function<T,R> rethrowFunction(FunctionWithException<T,R> function)
-
-