Skip to content

refactor(store): make Store interface error-returning for the Postgres backend #40

Description

@Bugs5382

Follow-up from PR #39 review (S0). The store.Store read methods and AddAuditEvent are error-free, so the Postgres backend must panic on query errors (a transient DB blip becomes a per-request panic recovered only by net/http, with no structured error to the client and no app-level logging). PR #39 mitigates with a recover middleware; the correct shape is for the interface to return error so Connect handlers map DB failures to CodeInternal and failures are observable.

Scope: change store.Store read methods + AddAuditEvent to return error, update both backends (memory returns nil) and all callers (fleet handlers). Cross-cutting; do as its own slice.

Part of #24.

Metadata

Metadata

Assignees

Labels

enhancementNew feature (feat). Minor version bump.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions