This is more of an observation so hopefully this can help someone if they run across a similar scenario.
I’d bet this is already known by some, apologies if this is common knowledge.
I needed to throw an exception in a Function if a condition was met. In addition to the exception being thrown, I wanted to pass a message back to the calling application to give it some context as to why the exception is being thrown. I also wanted the exception to return a “400” type error to the calling app.
In this case, I have an string output variable that stores the message back from the function.
Using the “Raise Exception” Widget in my function did indeed raise an exception, but I could not get it to send an output message other than the default “something went wrong” message, regardless of what I set my exception message to be.
I did try setting my output variable prior to the exception in his screenshot as well…
A postman call to that function to trigger the exception then shows this generic message (with a 400 error, thankfully)
In order to give it some context however, I found a custom code widget was a good way to both throw a 400 exception and display a custom message back to the calling app
Thanks for coming to my TED talk