Skip to content

[chore] replace substring-based isBusyErr with typed sqlite error sentinel #83

@kunallanjewar

Description

@kunallanjewar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: loreLore knowledge archivearea: questQuest board / task coordinationchoreMaintenance choregood first issueGood for newcomershelp wantedExtra attention is neededsize: S< 50 lines

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions