Sourcepoint has introduced a new error handling callback function called onError. The callback function is passed three parameters.
An error code (string) - the error code corresponds to one of five string values defined in the next section of this document.
A user reset value (boolean) - whether the user ID was reset for this individual.
The list of error codes passed to the function are below:
ACTION - The error came from an Action like a Custom Consent Action.
CHOICE - An error coming from an invalid choice action being provided to the script.
CMP_CALLBACK - An error thrown by the __tcfapi callback.
REQUEST - An error in the request sent to the Sourcepoint platform (i.e. a network error). In this case the user ID of the individual will be reset.
UNKNOWN - A generic unknown error occurred. In this case the user ID of the individual will be reset.
As noted above, the user ID of the site visitor will be reset when a REQUEST or an UNKNOWN error type occurs.
Below is an example of a callback configured to write the errorCode, errorObject and userReset value to the developer console.