I think i found my stupid mistake just need to wrap in a 
MessageException.

--- In flexcoders@yahoogroups.com, "truongdav" <[EMAIL PROTECTED]> wrote:
>
> Anyone know the answer for this?
> 
> 
> --- In flexcoders@yahoogroups.com, "truongdav" <truongdav@> wrote:
> >
> > Hi,
> > 
> > I am having problems I want to throw some exception on a remote 
> call 
> > and then display the Exception on the client side.  But this 
always 
> > returns an onResult instead of an onFault.  Anything I am doing 
> wrong?
> > 
> > Thanks.
> > 
> > 
> > --- POJO ---
> > public void test() throws Exception
> > {
> >   throw new exception("blah");
> > }
> > 
> > --- services.mxml --
> > 
> >     <mx:RemoteObject id="someServiceId" 
> >                      destination="someService" 
> >                      showBusyCursor="true" 
> >                      result="event.token.resultHandler( event )"
> >                      fault="event.token.faultHandler( event )">
> >     </mx:RemoteObject>
> > 
> > ---------
> > 
> >     public function execute( event : CairngormEvent ):void
> >     {
> >       var delegate : SomeDelegate = new SomeDelegate( this );
> >       var someEvent : SomeEvent = SomeEvent( event );
> >       delegate.test();
> >     }
> >     
> >     public function onResult( event : * = null ) : void
> >     {                               
> >           Alert.show("success");
> >     }
> >     
> >     public function onFault( event : * = null) : void
> >     {
> >       Alert.show(event.fault.message, "Error");
> >     }
> > --------
> > 
> >   public class SomeDelegate
> >   {
> >     public function SomeDelegate( responder : Responder )
> >     {
> >       this.service = ServiceLocator.getInstance().getService     
> > ( "someServiceId" );
> >       this.responder = responder;
> >     }
> >     
> >     public function test(): void
> >     {         
> >       var call : Object = service.test(); 
> >      
> >       call.resultHandler = responder.onResult;
> >       call.faultHandler = responder.onFault;
> >     }
> >     
> >     //------------------------------------------------------------
> > -
> > 
> >     private var responder:Responder;
> >     private var service:Object;
> >
>


Reply via email to