Docs/API reference/Errors

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.

HTTPCodeMeaning
401INVALID_SIGNATUREThe HMAC signature did not verify
401EXPIRED_REQUESTThe request timestamp was stale
401INVALID_APP_KEYUnknown application or key
401CREDENTIAL_REVOKEDThe server credential has been revoked
413PAYLOAD_TOO_LARGEThe event payload exceeded the size limit
429RATE_LIMITEDThe 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.