Skip to content

Commit 6f4cabc

Browse files
committed
Exit when can't load Storygraph library
1 parent 6a5d030 commit 6f4cabc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/good_audible_story_sync/storygraph/library.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ def self.load_from_web(client:, db_client:)
3333
->(book) { book.save_to_database(books_db) },
3434
T.proc.params(arg0: GoodAudibleStorySync::Storygraph::Book).void
3535
)
36-
library = client.get_read_books(process_book: save_book)
37-
library.update_sync_time(db_client.sync_times)
38-
library
36+
begin
37+
library = client.get_read_books(process_book: save_book)
38+
library.update_sync_time(db_client.sync_times)
39+
library
40+
rescue Client::Error => err
41+
puts "#{Util::ERROR_EMOJI} Error loading Storygraph library: #{err}"
42+
exit 1
43+
end
3944
end
4045

4146
sig { params(books_db: Database::StorygraphBooks).returns(Library) }

0 commit comments

Comments
 (0)