When leveraging JavaScript in a VDR, you force the request to fail by throwing an error. The error message that is passed to Error
will be returned in the response from Cloud Elements
In the JavaScript:
throw new Error('Your error message with context regarding request');
In the case of an error, the response from Cloud Elements:
{
"requestId": "5db2f26ee4b02bd2e4dc6fa5",
"message": "Javascript failed to execute: Your error message with context regarding request"
}