Distinguish service refusals, uncertain requests and local verification failures.
The SDK raises HAIPError for a non-success HTTP response, with status and the server’s stable code. Network timeouts, invalid responses and local verification failures may instead be ordinary errors.
import { HAIPError } from '@haip/sdk';try { await client.create(requestInput, stableIdempotencyKey);} catch (error) { if (error instanceof HAIPError) { console.error(error.status, error.code); } else { // The request outcome may be unknown. Do not invent a new creation key. throw error; }}
The client does not automatically retry mutations. Retrying a logical creation with the same key and identical material lets the service return its recorded result. A conflict requires inspection of current status, not a new execution identity or a weaker request.Never log credentials or the full private request while reporting errors. For user-facing messages, distinguish denied access, expired authority, quota pressure and deleted material without exposing another tenant’s resources.An execution verifier error means do not dispatch. After a durable fence or external effect exists, an error means retain evidence and reconcile; it is not permission to run the effect again. See protocol refusals and the counter example.