RTC Forums
November 24, 2024, 10:00:08 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Login
Register
RTC Forums
>
Subscription
>
Support
>
Exception
Pages: [
1
]
« previous
next »
Print
Author
Topic: Exception (Read 4270 times)
piotrsw
Newbie
Posts: 1
Exception
«
on:
January 27, 2012, 01:43:39 PM »
In case of exception my xml-rpc server returns:
<value><struct>
<member><name>faultCode</name><value><int>116</int></value></member>
<member><name>faultString</name><value><string>Error description</string></value></member>
</struct></value>
In OnReturn event i can get Result.asException but it returns string value. How to get faultCode and faultString from Result?
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: Exception
«
Reply #1 on:
January 27, 2012, 02:19:44 PM »
If you get a FaultCode as part of the XML-RPC result, the "asException" string will contain the FaultCode as well as the FaultString in the following format:
'#'+faultcode+':'+faultstring
In other words, if you have received FaultCode '116' and FaultString 'Error descriotion', then "asException" will return:
'#116:Error description'
The same way, if you are writing a Server and you want to return error message with FaultCode '116' and FaultString 'ErrorDescription', you would need to set the asException value to '#116:ErrorDescription'.
Note: A FaultCode of 0 (zero) is handled as "no fault code" and will result in "asException" containing only the FaultString, without the preceding "#0:'. In other words, if "asException" is returning a string which doesn't start with '#', then the Server has either sent a FaultCode 0, or hasn't explicitly set a FaultCode (left empty or null).
Best Regards,
Danijel Tkalcec
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...