pledge
Mar 5th, 2009, 06:16 AM
Hi,
I'm relatively new to both Flex and Spring MVC, so this may be a trivial question. I have created an exposed service and registered it with the Flex broker. This is working great. But I am now trying to work out how to best handle faults, and not managing to find much about it online. In certain cases I would like to throw exceptions from my service, such as in the case of failed spring security roles or illegal arguments (that may not have be possible to catch on the client, such as an invalid ID). At the moment I have a single fault handler for my RemoteObject which simply shows event.fault.faultString, i.e. the exception message.
So my question is: How are you handling exceptions and FaultEvents within your Spring-Flex applications?
One site I have found [1] talks about converting every exception into a FlexException (or subclass) and then parsing substrings on the fault message on the client side (that part sounds a little too brittle). Is this a good use case for a HandlerExceptionResolver? Is it possible to use that with Spring-Flex?
Thanks,
Martin.
[1] http://www.flexpasta.com/index.php/2008/05/16/exception-handling-with-blazeds-and-flex/
I'm relatively new to both Flex and Spring MVC, so this may be a trivial question. I have created an exposed service and registered it with the Flex broker. This is working great. But I am now trying to work out how to best handle faults, and not managing to find much about it online. In certain cases I would like to throw exceptions from my service, such as in the case of failed spring security roles or illegal arguments (that may not have be possible to catch on the client, such as an invalid ID). At the moment I have a single fault handler for my RemoteObject which simply shows event.fault.faultString, i.e. the exception message.
So my question is: How are you handling exceptions and FaultEvents within your Spring-Flex applications?
One site I have found [1] talks about converting every exception into a FlexException (or subclass) and then parsing substrings on the fault message on the client side (that part sounds a little too brittle). Is this a good use case for a HandlerExceptionResolver? Is it possible to use that with Spring-Flex?
Thanks,
Martin.
[1] http://www.flexpasta.com/index.php/2008/05/16/exception-handling-with-blazeds-and-flex/