We are building an LCDS 2.6 app that connects over HTTP/HTTPS channels.
Everything is working fine but we are trying to nail down the fault handling to
make things more fault tolerant.
There are a variety of connection and communication errors that fall into the
general bucket of "connection related errors that you need to reconnect to
correct".
We have implemented a central fault handler to that filters all faults and
checks for what we call "connection lost" faults. If one is found, we dispatch
a connection lost event which is handled by the application. The normal action
is to ask the user to re-login.
The problem is that I can't find a definitive list of the faultCodes that mx
rpc uses in order to write the handler. I'm reduced to setting a break point in
the fault handler and inspecting the faultCode in different scenarios. Does
Abobe maintain or does anyone know of a definitive list of faultCodes for
mx.rpc.events.FaultEvent.
This is current implementation of the check:
/**
* Return true if the fault for this responder is due to a lost session or
connection.
* This method checks for the following fault codes and if found returns true,
otherwise false.
*
* Note that try as we can, we have not been able to find a definitive list of
mx.rpc.events.FaultEvent
* fault codes. This list was built by trial and error.
*
* Client.Error.DeliveryInDoubt
* Client.Error.MessageSend
* Channel.Connect.Failed
* Channel.Call.Failed
* Client.Error.MessageSend
*
* @param faultEvent An RPC FaultEvent.
* @return true if the fault indicates that the connection/session is lost,
false otherwise
*/
public static function isConnectionLost(faultEvent:FaultEvent) : Boolean
{
if (faultEvent && faultEvent.fault)
{
if (faultEvent.fault.faultCode ==
"Client.Error.DeliveryInDoubt" // LCDS's way of saying "maybe, maybe not"
|| faultEvent.fault.faultCode == "Client.Error.MessageSend"
// The message could not be send
|| faultEvent.fault.faultCode == "Channel.Connect.Failed"
// The channel went missing
|| faultEvent.fault.faultCode == "Channel.Call.Failed"
// The channel isn't usable
|| faultEvent.fault.faultCode == "Client.Error.MessageSend")
// The client was unable to ssend the message
{
return true;
}
}
return false;
}
Thanks
Robert