Closed grawk closed 9 years ago
Also I found another test case to use where it seems the "flow.once" will cause subsequent uncaughtExceptions to be missed. Seeing if there's a way round that... If I just swap "once" with "on" then this listener will just keep capturing the same exception again and again
Further, this brings up the question of what if there is another listener on uncaughtException that throws the exception after processing? Could it develop a feedback loop?
One thought would be to add an event handler mechanism to the nemo namespace itself, and at anywhere in the flow lifecycle, you could add a handler to it:
nemo.on('uncaughtException', Promise);
And once all Promises are resolved on the exception, nemo logs the exception but doesn't throw it... Or by some other mechanism makes sure the final throw doesn't immediately trigger the event handlers again.
I went back to using flow.on
to attach the exception handler. To make sure the exception isn't handled more than once by the handler, before throwing the exception i attach a property to it exception._nemoScreenshotHandled
This would work as long as others follow a similar convention.
execu-merge
…ng to capture screenshots when no session is available