Write apps/backend/docs/contracts-error-catalog.md: every error shape the backend returns, across both transports. REST handlers return { error, ... } with varying extra fields; socket handlers emit an error event whose payload carries an event name and sometimes a code. There is currently no single place to look up what a client can receive.
Acceptance criteria:
- One table of REST errors: status,
error string, extra fields, and the route(s) that emit it
- One table of socket errors keyed by the emitted
event value, including the non-obvious ones — device_set_mismatch, protocol_mismatch, rate_limited, envelope_too_large
- Documents which errors are retryable and which are terminal
- Notes the rate-limit response shape (
429 plus Retry-After and RateLimit-* headers)
Write
apps/backend/docs/contracts-error-catalog.md: every error shape the backend returns, across both transports. REST handlers return{ error, ... }with varying extra fields; socket handlers emit anerrorevent whose payload carries aneventname and sometimes acode. There is currently no single place to look up what a client can receive.Acceptance criteria:
errorstring, extra fields, and the route(s) that emit iteventvalue, including the non-obvious ones —device_set_mismatch,protocol_mismatch,rate_limited,envelope_too_large429plusRetry-AfterandRateLimit-*headers)