Add error response handling

If your API returns responses with a status code above 400 that should not automatically throw an error then Zapier recommends enabling skipThrowForStatus. This feature allows you to create custom error handling script for status codes above 400. Note that 401 status codes will throw a RefreshAuthError regardless.

To enable skipThrowForStatus:

1. Enable skipThrowForStatus

  • Log into the Platform UI.
  • Select your integration.
  • In the Build section in the left sidebar, click Advanced.
  • Click the Settings tab.
  • Click the On toggle next to Enable skipThrowForStatus.
  • Click Save.

2. Use Code Mode to add error handling script

You’ll need to add error handling script to your authentication, triggers, actions that could encounter the error using Code Mode.

code screenshot

return z.request(options).then((response) => {
  if (response.status === 404) {
    throw new z.errors.Error(
      "Insert error message to user here",
      "InvalidData",
      404
    );
  }
  return response.json;
});

Learn more about general error handling in Zapier.


Need help? Tell us about your problem and we’ll connect you with the right resource or contact support.