Skip to content

Commit bc1f43c

Browse files
ShouldThrowServiceExceptionOnAddIfServiceErrorOccursAndLogItAsync -> PASS
1 parent fe03d04 commit bc1f43c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

LibraryManagement.Api/Services/Foundations/Books/BookService.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ public async ValueTask<Book> AddBookAsync(Book book)
7575

7676
throw bookDependencyValidationException;
7777
}
78+
catch (Exception exception)
79+
{
80+
var failedBookServiceException =
81+
new FailedBookServiceException(exception);
82+
83+
var bookServiceException =
84+
new BookServiceException(failedBookServiceException);
85+
86+
this.loggingBroker.LogError(bookServiceException);
87+
88+
throw bookServiceException;
89+
}
7890
}
7991
}
8092
}

0 commit comments

Comments
 (0)