RESTResponseV2 - getErrorCode()

Get the numeric error code if there was an error during the REST transaction.

This error code is specific to the ServiceNow platform, it is not an HTTP error code. Provide this error code if you require assistance from ServiceNow Customer Support

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Number The numeric error code, such as 1 for socket timeout.
var sm = new sn_ws.RESTMessageV2("Yahoo Finance","get"); //Might throw exception if message doesn't exist or not visible due to scope.
var response = sm.execute();
var errorCode = response.getErrorCode();