Errors
The gateway returns a stable, machine-readable error code and matching HTTP status for every rejected publish.
API· 3 min read
Stable error codes
When the gateway rejects a publish it returns an HTTP status and a stable code you can switch on. Codes do not change between releases.
| HTTP | Code | Meaning |
|---|---|---|
| 401 | INVALID_SIGNATURE | The HMAC signature did not verify |
| 401 | EXPIRED_REQUEST | The request timestamp was stale |
| 401 | INVALID_APP_KEY | Unknown application or key |
| 401 | CREDENTIAL_REVOKED | The server credential has been revoked |
| 413 | PAYLOAD_TOO_LARGE | The event payload exceeded the size limit |
| 429 | RATE_LIMITED | The publish rate limit was exceeded |
An expired request usually means clock skew between your server and the gateway. A revoked credential means you should rotate to a fresh one.
Handling errors in SDKs
Each server SDK surfaces a dedicated error type for non-2xx responses while leaving network and configuration problems as ordinary transport errors. None of the SDKs include the credential secret in their error output.
errors.ts
import { Client, EmitwaveError } from '@emitwave/node' try { await emitwave.trigger('orders', 'order.created', { id: 'ord_123' }) } catch (error) { if (error instanceof EmitwaveError) { // error.status is the HTTP status; error.body carries the stable code console.error('rejected', error.status, error.body) } }
See the equivalents on the Go and PHP SDK pages.
← Previous
Webhooks
Next →
—