Spicefactory Forum Index Spicefactory
Forum Archive
 
 SearchSearch    Log inLog in 

Silent errors in Parsley 3 commands

 
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory
View previous topic :: View next topic  
Author Message
after24



Joined: 19 May 2011
Posts: 10

PostPosted: Sun Oct 13, 2013 3:47 pm    Post subject: Silent errors in Parsley 3 commands Reply with quote

Hello,

I have an issue with the Parsley 3 command framework : every error occuring in the execute method of my commands (synchronous in this case) don't trigger any exception in the debugger (unlike what is explained on section 21.1.3 Error Handling of the Spicelib documentation).
I have found some posts talking about the same issue on the forum but the [CommandError] metatag proposed solution doesn't work for me.

I don't know if it's a configuration problem on my side or if it's a framework issue. Did someone experiment the same problem and found a solution ?

Thanks.
Back to top
View user's profile Send private message
after24



Joined: 19 May 2011
Posts: 10

PostPosted: Mon Oct 14, 2013 10:29 am    Post subject: Reply with quote

Until now, the only way if found to show an error is using a try/catch block in the command execute method :

Code:
public function execute(message:LeftMenuMessage):void
      {
         try
         {
            implementation of the method                     
         }
         catch(error:Error)
         {
            trace(error);
         }
      }


I must missing something... it would be great if someone who experienced the same issue and found a solution could help me on that Smile

Thanks
Back to top
View user's profile Send private message
after24



Joined: 19 May 2011
Posts: 10

PostPosted: Mon Oct 14, 2013 12:22 pm    Post subject: Reply with quote

For now I set up a turn around by modifying the Spicelib command framework :

in the org.spicefactory.lib.command.base.AbstractAsyncCommand Class

Code:
protected function error (cause:Object = null) : void {
      if (!active) {
         logger.error("Attempt to dispatch error event for command '{0}' although it is not active", this);
         return;
      }
      _active = false;
      
      throw cause;
      dispatchEvent(new CommandResultEvent(CommandResultEvent.ERROR, cause));
   }


By adding the
Code:
throw cause
line in the error method, the faulty command described in 21.1.3 Error Handling of the Spicelib is now working properly but I'm aware that my hack is very dirty...

Jens, if you still have a look at this forum, it would be great to have your opinion on the subject.

Thanks a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group