|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception com.perforce.p4java.exception.P4JavaException com.perforce.p4java.exception.RequestException
public class RequestException
An exception to be used to signal that the Perforce server has detected an error in processing or fielding a request. This error might be a usage error in a command sent to the server, or a missing or bad parameter, or a semantics error in the request. Note that this is not the same as a connection exception, which is typically signaled when the Perforce server itself can't be reached.
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 Summary | |
---|---|
RequestException()
|
|
RequestException(String message)
|
|
RequestException(String message,
int rawCode)
|
|
RequestException(String message,
int genericCode,
int severityCode)
|
|
RequestException(String message,
String codeString)
|
|
RequestException(String message,
Throwable cause)
|
|
RequestException(String message,
Throwable cause,
int genericCode,
int severityCode)
|
|
RequestException(Throwable cause)
|
|
RequestException(Throwable cause,
int genericCode,
int severityCode)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RequestException()
public RequestException(String message, Throwable cause)
public RequestException(String message)
public RequestException(Throwable cause)
public RequestException(String message, int rawCode)
public RequestException(String message, String codeString)
public RequestException(String message, int genericCode, int severityCode)
public RequestException(Throwable cause, int genericCode, int severityCode)
public RequestException(String message, Throwable cause, int genericCode, int severityCode)
Method Detail |
---|
public RequestException setCodes(int rawCode)
rawCode
- raw code from the server.
public void setSeverityCode(int severityCode)
public void setGenericCode(int genericCode)
public 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |