From 0550dd3d5a7ed2c2a9e6419927ab361d8fdd53f9 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 26 Jan 2026 11:32:45 -0500 Subject: [PATCH] Fix ebook scanner error handling for database queries - Remove string-based error checking for no rows - Use proper pgx.ErrNoRows comparison only - Improve error handling consistency in processEbookFile function --- internal/services/ebook_scanner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/ebook_scanner.go b/internal/services/ebook_scanner.go index 54e1da1..a5441f3 100644 --- a/internal/services/ebook_scanner.go +++ b/internal/services/ebook_scanner.go @@ -226,7 +226,7 @@ func (s *EbookScanner) processEbookFile(ctx context.Context, path string) error } fmt.Printf("Ebook already exists with same size, skipping: %s\n", path) return nil // Skip if already exists and size matches - } else if err != pgx.ErrNoRows && !strings.Contains(err.Error(), "no rows") { + } else if err != pgx.ErrNoRows { fmt.Printf("Database error checking ebook existence: %v\n", err) // Some other error occurred return fmt.Errorf("failed to check if ebook exists: %v", err)