-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add in exception processor for strongly typed SQL exeptions (#440)
- Loading branch information
1 parent
ae77958
commit 30fad32
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Produce useful SQL Server exceptions | ||
|
||
- Status: approved | ||
- Deciders: Daniel Mackay | ||
- Date: 2024-11-18 | ||
- Tags: ef-core | ||
|
||
Technical Story: https://github.com/SSWConsulting/SSW.CleanArchitecture/issues/408 | ||
|
||
## Context and Problem Statement | ||
|
||
EF Core typically throws `DbUpdateException` which doesn’t tell you much until you drill into the inner exceptions. If you do drill in you will find exceptions specific to the underlying DB Provider. But what if you change provider? Now you need to handle multiple exceptions for the same error. | ||
|
||
## Decision Drivers | ||
|
||
- Produce strongly typed useful exceptions | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "Option 1", because it does what we need and is far better than the default EF Core exceptions. | ||
|
||
## Pros and Cons of the Options | ||
|
||
### Option 1 - EntityFrameworkCore.Exceptions.SqlServer | ||
|
||
- ✅ Strongly typed exceptions | ||
- ❌ Additional dependency added |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters