Errors

All SDKs map PING8 API failures into predictable typed errors while preserving safe response context.

Server Codes

CodeMeaningSDK Error
1001API key missing, invalid, or unauthorizedAuthentication error
1002Caller IP is not whitelistedIP not allowed error
1003Invalid recipient or recipient group check failedInvalid recipient error
1004Bound template does not existTemplate not found error
1005Addresser/domain/engine validation failedAddresser error

HTTP And Transport Errors

ConditionSDK Error
HTTP 429Rate limit error
HTTP 5xxServer error
TimeoutTimeout error
Network failureTransport error
Non-JSON or malformed responseResponse error
Local invalid inputValidation error

Response Context

Where the language supports it, errors expose:

  • server code
  • HTTP status_code
  • parsed response_data
  • truncated safe response_text

API keys are not included in exception messages, repr output, docs examples, or logs.

Example

try {
  await client.send("user@example.com");
} catch (error) {
  if (error instanceof WorkonwardError) {
    console.error({
      code: error.code,
      statusCode: error.statusCode,
      message: error.message,
    });
  }
}