Skip to main content
Question

Feedback on REST Hook in Perform Subscribe

  • October 25, 2024
  • 2 replies
  • 45 views

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?

Did this topic help you find an answer to your question?

2 replies

MiguelC.
  • Zapier Staff
  • 9 replies
  • November 29, 2024

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!


  • Beginner
  • 1 reply
  • February 7, 2025

@eml7.cp did you resolve this?
I need to throw an error