Skip to main content

I'm developing a public integration that includes a REST hook, and I’d like to implement error handling in the performSubscribe method to provide feedback message to the end user if the subscription endpoint fails. Is this possible?

So far, I’ve validated non-200 status codes returned by the request, but when testing on the platform, it allows the Zap to turn on and then turns it off a few seconds later without any feedback.

Here the code:

const subscribeHook = async (z, bundle) => {  
const options = {
url: "<endpoint>",
body: data,
skipThrowForStatus: true
};

const response = await z.request(options);

if (response.status != 200) {
throw new z.errors.Error("User-friendly message", "SubscriptionError", response.status);
}

return response.data;
};

 

Or is it possible to use the performList method to return a message to the user during the 'Test' step of the trigger configuration?

Hi there, ​@eml7.cp

Thank you for your question: Miguel here from the Zapier Support team - Happy to lend a hand here!

It seems that you’re developing your own private app using our Developer Platform. If that’s the case, I’d suggest you raise a ticket through this page - https://developer.zapier.com/contact - as our team will be able to help you.

Hope this helps!


Reply