Skip to main content
Question

How to process Action errors in a meaningful way


What is the proper way of handling or processing errors when defining an Action for an integration. Right now if the Action web-service call fails during Zap setup/creation there is only a cryptic message with an HTTP status code displayed. The nicely worded error message that is returned is not displayed to the user. I assume that I am doing something wrong in my API Request code. I would like to know how retrieve or extract the error message and where/how return it.

 

 

const options = {
  url: 'https://www.website.org/doaction',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `api_key=${bundle.authData.api_key}`
  },
  params: {

  },
  body: create_update_data
}

return z.request(options).then((response) => {
  response.throwForStatus();
  const results = response.json;

  // You can do any parsing you need for results here before returning them

  return results;
});

 

 

 

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.