Skip to main content
Known Participant
February 21, 2013
Answered

[Flex 4.6] Handling PHP Fatal Errors in Flex with UrlRequest in UrlLoader or FileReference ?

  • February 21, 2013
  • 1 reply
  • 844 views

Note: I am not asking about services - it works there.

I am not getting any error events, just DataEvent.UPLOAD_COMPLETE_DATA or Event.COMPLETE event with data set to the php error message response.

Is there any way to make this work like with Services CallResponder fault event ? If yes, how do I do that ?

I've been looking a few hours for this answer and I don't seem to find how to do this. Is is possible at all?

Thanks!

This topic has been closed for replies.
Correct answer sinious

You should be handling service events yourself in PHP while sending Flash back a valid error response. Keep the error handling of every language within the language that it occurs and handle it yourself properly. You should be trapping all possible errors in the typical try/catch in PHP so you can send something useful back to Flash.

1 reply

sinious
siniousCorrect answer
Legend
February 23, 2013

You should be handling service events yourself in PHP while sending Flash back a valid error response. Keep the error handling of every language within the language that it occurs and handle it yourself properly. You should be trapping all possible errors in the typical try/catch in PHP so you can send something useful back to Flash.

FM_FlameAuthor
Known Participant
February 23, 2013

thanks, I also figured it out. Fatal errors and notices in php are not supposed to be cought cause they shouldn't be there in the first place. And handling Exceptions should be with a try catch with a proper response for flash to handle when using a normal request. When using an amf service you can do that via the fault event, it has the data of the PHP Exception.

sinious
Legend
February 24, 2013

Glad you got it sorted, good luck!