Fix error handling consistency in auto-import and fallback paths (#47)
* Fix error handling consistency in auto-import and fallback paths - Add error checking/warnings for auto-import CRUD operations (UpdateIssue, CreateIssue, AddDependency) - Add error checking/warnings for auto-import label operations (AddLabel, RemoveLabel) - Add warning when import hash storage fails (prevents unnecessary re-imports) - Add proper error handling for UserHomeDir with fallback to current directory These changes make auto-import error handling consistent with manual operations and prevent silent failures that could confuse users or cause data inconsistencies. * Remove invalid version property from golangci-lint config * Fix linter errors: errcheck, unused, goconst, and misspell - Fix unchecked error returns in ROLLBACK statements - Fix unchecked type assertion for status field - Extract LIMIT SQL constant to reduce duplication - Fix spelling: cancelled -> canceled - Remove unused ensureCounterInitialized function - Remove unused parameter in parallel test goroutine
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"github.com/steveyegge/beads/internal/types"
|
||||
)
|
||||
|
||||
const limitClause = " LIMIT ?"
|
||||
|
||||
// AddComment adds a comment to an issue
|
||||
func (s *SQLiteStorage) AddComment(ctx context.Context, issueID, actor, comment string) error {
|
||||
tx, err := s.db.BeginTx(ctx, nil)
|
||||
@@ -52,7 +54,7 @@ func (s *SQLiteStorage) GetEvents(ctx context.Context, issueID string, limit int
|
||||
args := []interface{}{issueID}
|
||||
limitSQL := ""
|
||||
if limit > 0 {
|
||||
limitSQL = " LIMIT ?"
|
||||
limitSQL = limitClause
|
||||
args = append(args, limit)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user