/// <summary> /// Stores books to <paramref name="storage"/> /// </summary> /// <exception cref="ArgumentNullException">Throws if <paramref name="storage"/> /// is null</exception> /// <exception cref="BookListException">Throws if some errors while storing books /// if <paramref name="storage"/></exception> public void StoreBooksList(IBookListStorage storage) { if (ReferenceEquals(storage, null)) { throw new ArgumentNullException(); } try { logger.Debug("Saving book list."); storage.StoreBookList(list); } catch (Exception ex) { logger.Warn(ex, "An error has occurred during saving book's list to storage."); throw new BookListException($"An error has occurred during saving book's list to {nameof(storage)}.", ex); } }