Skip to main content
The SDK throws AvatarSDKError for every failure, including validation, authentication, network, and Metadata Service errors. Inspect error.code to branch on the cause.

Error codes

Metadata Service errors

When the Metadata Service returns an error, the SDK normalizes it into AvatarSDKError with code: 'API_ERROR'. The HTTP status is on error.status, the service-specific code is on error.serviceCode, and the structured envelope is on error.details.