Skip to main content

getCommsErrorCode()

function getCommsErrorCode(error: unknown): number | null;

The numeric error_code the API sends in an error body, when there was one.

Parameters​

ParameterTypeDescription
errorunknownThe thrown value to inspect.

Returns​

number | null

The code, or null when the error is not a CommsRequestError or carried no numeric error_code.