Closed rvalle closed 13 years ago
Yes, good point. That bit of code you are referring to is a hold over from the older statechart framework. The intention back then was to handle any exception so that the state transition would finish and your app wouldn't crash. However, looking at it now, it really doesn't need to be there. This is something I'll address. Thanks for the notice.
Yes, now the statechart does complete the transition without problem at all. The issue for me, was realizing that there was an exception happening.
May be in some cases either situation is the desired one. Perhaps, instead of throwing the exception and breaking the state-chart there could be a similar exceptionhandle inside the startechart (or if SC.ExceptionHandle.handleException() returns, the statechart can proceed as normal).
Something that could be cool is to give each state the possibility to handle the exception itself, that would make it possible to manage complex exception handle: such as implementing a "retry" state when a server cannot be reached or is too busy, (re)logon and continue where you was if the session has expired, etc.
those are interesting ideas. I'll play around with it and see what works. But this is something that needs to be addressed in one form or another.
this has been addressed. try-catch has been removed
HI!
statechart.sendEvent is silently handling all exceptions.
Shouldn't this exceptions be thrown and available for: SC.ExceptionHandler.handleException() to process?