fix(errors): shared error schema, sendError helper, correct 502/500 status codes (#66)
Fastify's fast-json-stringify was silently stripping message and statusCode
from error responses because most route schemas only declared { error: string }.
The global error handler sends { error, message, statusCode } but those extra
fields never reached clients.
- Add shared errorResponseSchema and sendError() helper in api-errors.ts
- Replace 16 per-route errorJsonSchema definitions with the shared import
- Split PDS + DB try/catch blocks in topics, replies, reactions so PDS
failures return 502 (Bad Gateway) and local DB failures return 500
- Change auth session and setup service errors from 502 to 500 (local ops)
- Update tests to match new response shape and status codes
authored by