Skip to content

Add descriptions to some error cases so they include context of where they were thrown from#44

Merged
roanutil merged 4 commits intomainfrom
feature/identified-description
Feb 26, 2026
Merged

Add descriptions to some error cases so they include context of where they were thrown from#44
roanutil merged 4 commits intomainfrom
feature/identified-description

Conversation

@roanutil
Copy link
Owner

This is an API breaking change so it would require a major version release.

I'm not 100% happy with how this is implemented but I can't think of any better options.

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 36.17021% with 90 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.07%. Comparing base (311edfe) to head (c46b111).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
Sources/CoreDataRepository/CoreDataError.swift 0.00% 33 Missing ⚠️
...ataRepository/Internal/AggregateSubscription.swift 0.00% 13 Missing ⚠️
...itory/Internal/AggregateThrowingSubscription.swift 0.00% 13 Missing ⚠️
...eDataRepository/CoreDataRepository+Aggregate.swift 0.00% 11 Missing ⚠️
...DataRepository/CoreDataRepository+Read_Batch.swift 0.00% 6 Missing ⚠️
...taRepository/CoreDataRepository+BatchRequest.swift 0.00% 3 Missing ⚠️
...taRepository/CoreDataRepository+Delete_Batch.swift 0.00% 2 Missing ⚠️
...s/CoreDataRepository/FetchableUnmanagedModel.swift 0.00% 2 Missing ⚠️
.../CoreDataRepository/IdentifiedUnmanagedModel.swift 50.00% 2 Missing ⚠️
...ternal/ModelsWithIntId/IdentifiableModel_Int.swift 0.00% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
- Coverage   84.44%   84.07%   -0.37%     
==========================================
  Files          69       69              
  Lines        7584     7654      +70     
==========================================
+ Hits         6404     6435      +31     
- Misses       1180     1219      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@r-jarvis
Copy link
Collaborator

Yeah... I don't really see any path for this in which we can avoid a breaking change. I went over the code at a high level and I think it makes sense for the most part. If you think it's ready to publish I will go through more detailed and review the code.

@roanutil
Copy link
Owner Author

Yeah... I don't really see any path for this in which we can avoid a breaking change. I went over the code at a high level and I think it makes sense for the most part. If you think it's ready to publish I will go through more detailed and review the code.

Let's merge #43 first so all of those changes are mixed in here.

…where they were thrown

feature/identified-description
feature/identified-description
feature/identified-description
@roanutil roanutil force-pushed the feature/identified-description branch from 7f51d14 to c3dbce3 Compare February 24, 2026 14:47
@roanutil roanutil marked this pull request as ready for review February 24, 2026 14:48
@ryan-mfb
Copy link

Code review

Found 1 issue:

  1. Documentation example violates new API signature

The documentation comment in ReadableUnmanagedModel.swift shows an example that uses the old API: throw CoreDataError.noMatchFoundWhenReadingItem without parameters. However, this PR changes the error case to require a description: String parameter, making the documentation example non-compilable.

/// guard let managed = fetchResult.first, fetchResult.count == 1 else {
/// throw CoreDataError.noMatchFoundWhenReadingItem
/// }

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

feature/identified-description
@roanutil roanutil merged commit e5ec1cc into main Feb 26, 2026
2 checks passed
@roanutil roanutil deleted the feature/identified-description branch February 26, 2026 18:03
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.

4 participants