Skip to content

Commit ff64fd0

Browse files
ShouldThrowServiceExceptionOnAddIfServiceErrorOccursAndLogItAsync -> PASS
1 parent 6287256 commit ff64fd0

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
@@ -75,6 +75,18 @@ public async ValueTask<Reader> AddReaderAsync(Reader reader)
7575

7676
throw readerDependencyValidationException;
7777
}
78+
catch (Exception exception)
79+
{
80+
var failedReaderServiceException =
81+
new FailedReaderServiceException(exception);
82+
83+
var readerServiceException =
84+
new ReaderServiceException(failedReaderServiceException);
85+
86+
this.loggingBroker.LogError(readerServiceException);
87+
88+
throw readerServiceException;
89+
}
7890
}
7991
}
8092
}

0 commit comments

Comments
 (0)