Summary
Two copies of isBusyErr (one in internal/lore/tx.go, one in internal/quest/accept.go) parse SQLite busy-state via string matching on the error message. modernc.org/sqlite exposes a typed sqlite.Error value with a numeric code, so the check can be replaced with a single errors.As / errors.Is-based helper.
Affected files
internal/lore/tx.go (line 74)
internal/quest/accept.go (line 176)
Acceptance
- Single shared helper in a sensible package (e.g.
internal/storage/).
- Helper uses typed error sentinels rather than
strings.Contains.
- Both call sites (lore tx + quest accept retry loops) use the new helper.
- Existing tests pass; no behavioral change expected.
Summary
Two copies of
isBusyErr(one ininternal/lore/tx.go, one ininternal/quest/accept.go) parse SQLite busy-state via string matching on the error message. modernc.org/sqlite exposes a typedsqlite.Errorvalue with a numeric code, so the check can be replaced with a singleerrors.As/errors.Is-based helper.Affected files
internal/lore/tx.go(line 74)internal/quest/accept.go(line 176)Acceptance
internal/storage/).strings.Contains.