-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom message to ConcurrencyException (#568)
Co-authored-by: Mike Alhayek <[email protected]>
- Loading branch information
1 parent
e2b1e32
commit 01fea28
Showing
2 changed files
with
6 additions
and
2 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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
using System; | ||
using System.Reflection.Metadata; | ||
|
||
namespace YesSql | ||
{ | ||
public class ConcurrencyException : Exception | ||
{ | ||
public ConcurrencyException() : base("The document could not be updated as it has been changed by another process.") | ||
public Document Document { get; } | ||
|
||
public ConcurrencyException(Document document) : base($"The document with Id '{document.Id}' and type '{document.Type}' could not be updated as it has been changed by another process.") | ||
{ | ||
Document = document; | ||
} | ||
} | ||
} |
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