public class RequestException extends P4JavaException
RequestExceptions coming back from the server have a non-zero rawCode field that is set to the corresponding raw code value sent from the server; this code normally requires processing for use by callers, who typically want to see the correspond generic and severity codes, but it's available here if needed. Other segments or interpretations of the raw code -- subCode, subSystem, uniqueCode, and the raw code itself -- are available here if you need them and know what they mean. Note, though, that only the generic and severity codes are documented in the main Perforce documentation, and only those fields are guaranteed to be set to meaningful values here (in fact, all RequestExceptions constructed 'under the covers' in the RPC layer will do what they can to get meaningful value for these other fields, but this is not guaranteed)...
Note that if you set the raw code yourself using the accessor methods, you are required to also set the other fields to appropriate values yourself; failure to do this will cause a lot of confusion up the chain, as the subsidiary codes are only calculated once. The setCodes method is provided to make this easy.
See the MessageSeverityCode and MessageGenericCode definitions for suitable help with those types of code.
Constructor and Description |
---|
RequestException() |
RequestException(java.lang.String message) |
RequestException(java.lang.String message,
int rawCode) |
RequestException(java.lang.String message,
int genericCode,
int severityCode) |
RequestException(java.lang.String message,
java.lang.String codeString) |
RequestException(java.lang.String message,
java.lang.Throwable cause) |
RequestException(java.lang.String message,
java.lang.Throwable cause,
int genericCode,
int severityCode) |
RequestException(java.lang.Throwable cause) |
RequestException(java.lang.Throwable cause,
int genericCode,
int severityCode) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDisplayString() |
int |
getGenericCode()
Get the Perforce generic code associated with this exception, if any.
|
int |
getRawCode() |
int |
getSeverityCode()
Get the Perforce severity code associated with this exception, if any.
|
int |
getSubCode() |
int |
getSubSystem() |
int |
getUniqueCode() |
RequestException |
setCodes(int rawCode)
Set the raw code and associated subsidiary codes according to
the passed-in values.
|
void |
setGenericCode(int genericCode) |
void |
setSeverityCode(int severityCode) |
void |
setSubCode(int subCode) |
void |
setSubSystem(int subSystem) |
void |
setUniqueCode(int uniqueCode) |
public RequestException()
public RequestException(java.lang.String message, java.lang.Throwable cause)
public RequestException(java.lang.String message)
public RequestException(java.lang.Throwable cause)
public RequestException(java.lang.String message, int rawCode)
public RequestException(java.lang.String message, java.lang.String codeString)
public RequestException(java.lang.String message, int genericCode, int severityCode)
public RequestException(java.lang.Throwable cause, int genericCode, int severityCode)
public RequestException(java.lang.String message, java.lang.Throwable cause, int genericCode, int severityCode)
public RequestException setCodes(int rawCode)
rawCode
- raw code from the server.public void setSeverityCode(int severityCode)
public void setGenericCode(int genericCode)
public java.lang.String getDisplayString()
public int getUniqueCode()
public void setUniqueCode(int uniqueCode)
public int getRawCode()
public int getSubCode()
public void setSubCode(int subCode)
public int getSubSystem()
public void setSubSystem(int subSystem)
public int getSeverityCode()
public int getGenericCode()