Search code examples
javascriptzapier

How to make Zapier code step fail while getting output info


My task history shows a lot of successful code steps that actually were not successful. How do I write my JavaScript code to make the task fail (so that I'm alerted there is something wrong) AND receive an output? So far, I've only been able to do one or the other - When I make the task fail (by throwing an exception or calling callback('Failure', output), no output is visible in the task history. console.log results in an empty log, for some reason.


Solution

  • Well, nobody seems to know the answer and one person thinks it's a bad question. At this point I'm fairly certain that what I was asking for is not possible. So, in case anyone wonders, I came to the conclusion that you should:

    • Include any useful information in the exception you're throwing, or
    • Catch all possible exceptions and add another code step which throws an exception based on the output of the first one.