Azure / azure-functions-durable-js

JavaScript library for using the Durable Functions bindings
https://www.npmjs.com/package/durable-functions
MIT License
128 stars 47 forks source link

Orchestrators that simply throw an exception have that exception "swallowed" #391

Open davidmrdavid opened 1 year ago

davidmrdavid commented 1 year ago

Consider an orchestrator that simply runs:

throw "oops!"

The orchestrator will correctly be labeled as Failed, but the error message will read "With OOProc schema V3, expected actions array to be of length 1 in outer layer but got size: 0""

The correct behaviour is that the error should be that of the exception in the user code.

davidmrdavid commented 1 year ago

FYI @hossam-nasr

davidmrdavid commented 1 year ago

Relatedly: it seems that throw statements that do not throw an Error type are not correctly propagated either. In other words, the only exceptions that are correctly propagated are those that throw an Exception-type.

For instance: throw new Error("oops!"); will work, but throw "oops!" will not.