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
This commit is contained in:
2026-01-26 11:32:45 -05:00
parent ba80ace1be
commit 0550dd3d5a
+1 -1
View File
@@ -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)