The ArgumentSpecifierImpl class swallows errors that happen while calling the take() method in the action.
As such you loose track of where the error actually happened and its stacktrace. Very confusing to just see the stacktrace stop at ArgumentSpecifierImpl, lin 71.
{{{
!actionscript
public function take(stubbingContext:StubbingContext):void
{
if (!action)
throw new ArgumentActionNotSpecified("Did you forget to specify action for the argument?");
try
{
action.take(stubbingContext.args[index]);
} catch (e:Error)
{
throw new ArgumentActionFailed("While evaluating argument " + index + " failed to " + action.describe() + " : " + e.message);
}
}
}}}
Therefore I changed ArgumentSpecifierImpl and ArgumentActionFailed to provide a more clear error stacktrace.
Have a look at the attachments.
Can this be incorporated in the next release?
The ArgumentSpecifierImpl class swallows errors that happen while calling the take() method in the action.
As such you loose track of where the error actually happened and its stacktrace. Very confusing to just see the stacktrace stop at ArgumentSpecifierImpl, lin 71. {{{
!actionscript
public function take(stubbingContext:StubbingContext):void { if (!action) throw new ArgumentActionNotSpecified("Did you forget to specify action for the argument?"); try { action.take(stubbingContext.args[index]); } catch (e:Error) { throw new ArgumentActionFailed("While evaluating argument " + index + " failed to " + action.describe() + " : " + e.message); } } }}}
Therefore I changed ArgumentSpecifierImpl and ArgumentActionFailed to provide a more clear error stacktrace. Have a look at the attachments. Can this be incorporated in the next release?
Thanks!