4 Replies Latest reply on Mar 18, 2008 7:19 AM by Ansury

    Cairngorm/Remoting best practice question

    Ansury Level 3
      Is the fault() function of a Cairngorm command meant for ONLY for handling failures that aren't expected to happen? (i.e. only can be caused as the result of a bug or server problem)

      Can fault() also be used to handle a "normal" error, such as doing a search in Active Directory (apparently throws exceptions for every ******* thing imaginable) when the search returns no results or too many results?

      The way I would think it should work is to only use fault() for errors that would be caused by code bugs or server malfunctions. (Unexpected exceptions that aren't handled on the server, that get passed to FDS/Granite/BlazeDS during a remote object call.)

      If something like a login failure (bad password) or a search "failure" (no / too many results) happens to throw an exception on the server wouldn't you want to catch that exception on the server and then return back a "normal" response to Flex via remoting, which is then handled appropriately in result()?

      I'm currently in a position where I have to argue this case but I'm not making much headway, so could I get some second opinions on this one? Am I wrong here? It seems easier to just let the exceptions be tossed back to Flex where you can display the exception's detailed message, but I don't trust that to be reliable and to give decent user-friendly feedback every time.