Exception handler doesn't work if action is called from Javascript

Hello. I have just found out this behavior. In mobile app, I have OnException handler:

When a client action throws exception, if it is put as normal action into a flow - that exception gets into this handler. If it's called from javascript (like $actions.SomeAction(); ) - then it does not.

Is this a bug or intended? If it is a bug, than can this be put to backlog to be fixed? If it is intended, than I wonder what is the reason.

Thanks.

Hey Igor.

Allegedly, if a javascript snippet invokes a function and that function returns an error, the exception handling shall be done by the invoker. if the invoker is not handling the error, it should propagate. My suggestion is that you use a catch in your javascript to see if it throws the error or not. 

Or remote debug it. :)

Cheers!

Armando Gomes wrote:

Hey Igor.

Allegedly, if a javascript snippet invokes a function and that function returns an error, the exception handling shall be done by the invoker. if the invoker is not handling the error, it should propagate. My suggestion is that you use a catch in your javascript to see if it throws the error or not. 

Or remote debug it. :)

Cheers!


Hi Armando,

That's what I was expecting - that it should propagate and be caught by global exception handler. But it doesn't happen. I was debugging and experimenting and I have found out that if I drop the action into the flow - that comes into the handler, but if I have it called from javascript element inside the same flow - than it's not. And yes I know that it throws the error. That error is logged but that logging seems to happen in some built-in handler because I didn't have any other then global one.