flowpipe icon indicating copy to clipboard operation
flowpipe copied to clipboard

Better handling of exceptions during node evaluation.

Open neuneck opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. When a node's compute method raises an exception, there's no neat way of handling that within flowpipe.

Describe the solution you'd like I would like to be able to add an exception handler to nodes that gets executed when the node's compute raises an exception. Additionally, I would like to extend the Event interface, so that some events can provide additional information to their listeners, in this case the exception object.

Describe alternatives you've considered As of now, all compute methods we use have a lot of exception handling, since any uncaught exception will interrupt the entire flow's execution. While this works, it's not elegant.

neuneck avatar Apr 16 '21 13:04 neuneck

Hi there,

I'm also looking for the best way to handle exceptions generated inside the compute function. As there been any developement on this?

As of now, all compute methods we use have a lot of exception handling, since any uncaught exception will interrupt the entire flow's execution. While this works, it's not elegant.

Once an exception is raised, how to you handle the flow of the graph? Do you interrupt it? Do you only interrupt downstream nodes ?

In our use case, interrupting the whole graph would be appropriate. Any advice on how to properly implement that?

DaveMtl avatar Oct 21 '21 16:10 DaveMtl

If interrupting the entire Graph is what you want, I would suggest you simply catch the exception outside the Graph execution. I want the Graph to finish executing, so I return a result type with information about the error and check for that result in all downstream nodes.

On Thu, Oct 21, 2021, 18:14 DaveMtl @.***> wrote:

Hi there,

I'm also looking for the best way to handle exceptions generated inside the compute function. As there been any developement on this?

As of now, all compute methods we use have a lot of exception handling, since any uncaught exception will interrupt the entire flow's execution. While this works, it's not elegant.

Once an exception is raised, how to you handle the flow of the graph? Do you interrupt it? Do you only interrupt downstream nodes ?

In our use case, interrupting the whole graph would be appropriate. Any advice on how to properly implement that?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PaulSchweizer/flowpipe/issues/153#issuecomment-948768022, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQRVUCD5BX7N4T5UPOWHXDUIA343ANCNFSM43BRECZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

neuneck avatar Oct 21 '21 17:10 neuneck

Makes sense, thanks!

DaveMtl avatar Oct 21 '21 17:10 DaveMtl