Skip to main content

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;
});