Skip to content

Commit b39b853

Browse files
ShouldThrowDependencyValidationExceptionOnModifyIfDatabaseUpdateConcurrencyErrorOccursAndLogItAsync -> PASS
1 parent 5780055 commit b39b853

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

LibraryManagement.Api/Services/Foundations/Readers/ReaderService.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ public async ValueTask<Reader> ModifyReaderAsync(Reader reader)
101101

102102
throw readerDependencyException;
103103
}
104+
catch (DbUpdateConcurrencyException dbUpdateConcurrencyException)
105+
{
106+
var lockedReaderException =
107+
new LockedReaderException(dbUpdateConcurrencyException);
108+
109+
var readerDependencyValidationException =
110+
new ReaderDependencyValidationException(lockedReaderException);
111+
112+
this.loggingBroker.LogError(readerDependencyValidationException);
113+
114+
throw readerDependencyValidationException;
115+
}
104116
catch (DbUpdateException dbUpdateException)
105117
{
106118
var failedReaderStorageException =

0 commit comments

Comments
 (0)