AMF Error handling question in Flex

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

AMF Error handling question in Flex

After24
Hi,

I'm struggling to handle AMF errors using AMFPHP : if I deliberately cause a
MySQL Error during a service method call, the faultEvent dispatched on the
client doesn't contains any informations about the error cause : [RPC Fault
faultString="Echec de l'envoi" faultCode="Client.Error.MessageSend"
faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed:

But by using a web debugging proxy like Charles, I can see that the raw AMF
data of the response contains the message describing the MySQL error :
/1146: Table 'erp_dev.officeEmployee1' doesn't exist<br>  SELECT u.userId
etc./

Does anyone knows how I can access the raw data of an AMF response ? (I'm
using the mx.rpc.remoting.RemoteObject class to call the services)

Thank you.




--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: AMF Error handling question in Flex

Olaf Krueger
Hi,

>Does anyone knows how I can access the raw data of an AMF response ? (I'm
>using the mx.rpc.remoting.RemoteObject class to call the services)

If I remember it correctly, an alternative is to implement a custom error
handler in order to throw an exception, something like this:

$stmt = $dbh->prepare('bogus sql');
if (!$stmt) {
   throw new Exception($dbh->errorInfo());
}


Maybe this helps,
Olaf



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: AMF Error handling question in Flex

After24
Hi Olaf,

Thank you for your answer, I will take a look in this direction.

Vincent.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: AMF Error handling question in Flex

After24
Olaf,

You were correct :-)

Thank you again.

Vincent.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/