Also add exception message to top-level rescue

pull/12/head
Prad Nelluru 3 years ago
parent 1d2f53bad0
commit db2d86c1a8
  1. 2
      src/muse-dl.cr

@ -79,12 +79,14 @@ module Muse::Dl
delay_secs /= 2
end
rescue ex : Muse::Dl::Errors::DownloadError
puts ex.message
puts ex.backtrace.join("\n ")
puts "Download error. Skipping book: #{url}. Waiting for #{delay_secs} seconds before continuing."
# Sleep to prevent hammering the server.
sleep(delay_secs)
delay_secs *= 2
rescue ex
puts ex.message
puts ex.backtrace.join("\n ")
pp ex
puts "Non-download error. Skipping book: #{url}."

Loading…
Cancel
Save