Skip to content

Error handling#2

Merged
unorsk merged 2 commits intomainfrom
error-handling
Feb 10, 2026
Merged

Error handling#2
unorsk merged 2 commits intomainfrom
error-handling

Conversation

@unorsk
Copy link
Owner

@unorsk unorsk commented Feb 10, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves repository-layer error handling by distinguishing “not found” cases from genuine SQLite/database failures, and adds tests to validate the new behavior.

Changes:

  • Map rusqlite::Error::QueryReturnedNoRows to AppError::{DeckNotFound, CardNotFound} while propagating other rusqlite errors as AppError::Db.
  • Update deck_id_by_name, update_deck, and get_card_row to preserve underlying DB errors instead of masking them as “not found”.
  • Add unit tests covering missing-entity vs schema/DB-error scenarios for these code paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unorsk unorsk merged commit 3003a5e into main Feb 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants