manokovacs/aopromise

How to write an advice that executes whenever object fn throws exception

Opened this issue · 1 comments

I am using db calls which return a Promise. But if DB ops fail, they throw an exception, which gets handled by the .catch(fn(){...}) block. Is there a way to execute an advice whenever there is an exception thrown?

I have also created a stackoverflow issue here.

@rvnath, good point. Actually its not yet documented, but you can do it. I gave a more detailed answer on stackoverflow, where I link this test which checks this actual feature. Let me know if that works for you!