View previous topic :: View next topic |
Author |
Message |
after24
Joined: 19 May 2011 Posts: 10
|
Posted: Sun Oct 13, 2013 3:47 pm Post subject: Silent errors in Parsley 3 commands |
|
|
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 |
|
 |
after24
Joined: 19 May 2011 Posts: 10
|
Posted: Mon Oct 14, 2013 10:29 am Post subject: |
|
|
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
Thanks |
|
Back to top |
|
 |
after24
Joined: 19 May 2011 Posts: 10
|
Posted: Mon Oct 14, 2013 12:22 pm Post subject: |
|
|
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 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 |
|
 |
|