Error Types
The Go SDK uses typed errors that implement theerror interface. Use type assertions to handle specific error types.
APIError
Returned for any non-2xx HTTP response (except 401/403).
AuthError
Returned for 401 (Unauthorized) and 403 (Forbidden) responses. Embeds *APIError.
TokenError
Returned from VerifyGrantToken() for token verification failures.
NetworkError
Returned for network-level failures (DNS, timeout, connection refused).
Handling Pattern
Unwrap Support
TokenError and NetworkError implement Unwrap() for use with errors.Is() and errors.As():