I have a custom node that I have created and I’m curious what my options are for error handling. The node does a function and then for both success and failure, we utilize the binary output to provide an html report to the user stating what happened. It does this similar to the If Node where it has a success and failure output that the user will choose from based on the success of the node. This works great, but the only problem is that the node completes successfully which puts a Green Circle above the node. This is misleading to the user because they think the Node was successful when in reality, the node completed but the return of the function was unsuccessful.
The only other option I see is to throw an error if the function is unsuccessful. This does give a nice Red X above the Node informing the user it was unsuccessful which is great… but then inside the node details, you cannot use a binary report or formatted strings. It just gives you the string you passed into the error.
Is there anyway to have a node finish with the Red X when it is unsuccessful AND provide a Binary Report within the Node details and not just a string?
Here are some pictures to try to illustrate what I am looking for:
Here, a node completes but it is actually unsuccessful, which is misleading to the user:
On the other hand, this has a binary report for the failure data which gives the user a lot of info on what happened (once they click Show Binary Data):
We can fix one part of this by throwing an error in the code instead:
But now we lose the ability to give them a binary report or any kind of response other than a plain string which makes it difficult to provide the user with a useful failure message:
Please let me know if there is a solution/workaround for this and let me know if you have any questions!