Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 20 Using TIBCO Object Service Broker SDK (Java) : SessionException Object Methods

SessionException Object Methods
SessionException
The SessionException class constructor.
This method has two forms:

 
public SessionException(int rc,
int reasonCode)
or
 
public SessionException(String ruleErrorText)

 
In the first form, SessionException constructs a SessionException object with the specified error code and error reason code. The resulting exception error message string (available using a java.lang.Throwable.getMessage call) contains the following: {error code description} - {error reason code description available via errorReasonDescr}. For example, if a startTrans method throws an exception due to the interface calls being out of sequence, the error message string is: “JCLI transaction startup failed - Interface calls are out of sequence”. The SDK (Java) uses this form of the SessionException constructor to report all errors with an error reason code other than SessionException.RULEFAILED (3091).
In the second form, SessionException constructs a SessionException object with the SessionException.CALLRULE_FAILED (11) return code, a SessionException.RULEFAILED (3091) error reason code, and a specified error message. The resulting exception error message string (available using a java.lang.Throwable.getMessage call) contains the following: {error code description} - {ruleErrorText}. For example, if a call("MYRULE"...) throws an exception because the MYRULE rule encountered an access error on table named MYTABLE, the error message string is “JCLI rule call failed - Access error on TABLE "MYTABLE"”. The error reason code for these errors is always SessionException.RULEFAILED (3091). The SDK (Java) uses this form of the SessionException constructor to report rule failures, passing the string available via endMessage at the end of the call as a ruleErrorText parameter.
Parameters:
 
Return Value:
None.
Comments
You can access the exception error message string using the getMessage() method or the toString() method defined in the java.lang.Throwable class.
errorReasonDescr
Returns a textual description of a particular SDK (Java) error reason code.

 
public String errorReasonDescr(int reasonCode)

 
Parameters:
 
Return Value:
For a list of error reason codes, refer to Appendix A, SDK (C/C++) and SDK (Java) Error Reason Codes.
Comments
Use the reasonCode method to retrieve the value of a particular error reason code.
reasonCode
Returns an error reason code for an SDK (Java) error.

 
public int reasonCode()

 
Parameters:
None.
Return Value:
For a list of error reason codes, refer to Appendix A, SDK (C/C++) and SDK (Java) Error Reason Codes.
Comments
Use the errorReasonDescr method to retrieve a textual description of a particular error reason code.
rc
Returns an SDK (Java) operation error code.

 
public int rc()

 
Parameter:
None.
Return Value:
Depending on the method that failed, the error returned is one of the following:

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved