Commit graph

2 commits

Author SHA1 Message Date
beads/crew/lizzy
1bcfe0a79d chore: unexport ~29 dead symbols in internal/storage/sqlite
Unexport package-internal symbols with no external callers:
- errors: IsConflict, IsCycle, IsNotFound
- util: IsUniqueConstraintError (removed duplicate), IsForeignKeyConstraintError, IsBusyError
- external_deps: CheckExternalDep, CheckExternalDeps, GetUnsatisfiedExternalDeps, ExternalDepStatus
- collision: CollisionResult, CollisionDetail, RenameDetail
- ids: GetAdaptiveIDLength, IsHierarchicalID, ValidateIssueIDPrefix, GenerateBatchIssueIDs, EnsureIDs
- freshness: FreshnessChecker, NewFreshnessChecker
- migration_invariants: MigrationInvariant, CleanOrphanedRefs
- migrations: MigrationInfo
- schema_probe: SchemaProbeResult, ErrSchemaIncompatible
- ready: ExcludeIDPatternsConfigKey, DefaultExcludeIDPatterns
- config: CustomStatusConfigKey, CustomTypeConfigKey

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 09:29:56 -08:00
Steve Yegge
3b2cac4d8f Centralize error handling patterns in storage layer (bd-bwk2)
Created internal/storage/sqlite/errors.go with:
- Sentinel errors: ErrNotFound, ErrInvalidID, ErrConflict, ErrCycle
- wrapDBError helpers that auto-convert sql.ErrNoRows to ErrNotFound
- Type-safe error checking with errors.Is() compatibility

Updated error handling across storage layer:
- dirty.go: Added context to error returns, converted sql.ErrNoRows checks
- util.go: Updated withTx to use wrapDBError
- batch_ops.go: Added context wrapping to batch operations
- dependencies.go: Wrapped errors from markIssuesDirtyTx calls
- ids.go: Added error wrapping for ID validation

Also restored sqlite.go that was accidentally deleted in previous commit.

All tests pass. Provides consistent error wrapping with operation context
for better debugging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 19:17:57 -05:00