more descriptive error messages

This commit is contained in:
Prad Nelluru 2020-04-19 15:18:05 -04:00
parent 77201bda85
commit 762164e223
1 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ module Muse::Dl
# https://muse.jhu.edu/book/67393 # https://muse.jhu.edu/book/67393
# Errors are Unable to determine page runs / Unable to construct chapter PDF # Errors are Unable to determine page runs / Unable to construct chapter PDF
if /Unable to/.match line if /Unable to/.match line
raise Muse::Dl::Errors::MuseCorruptPDF.new raise Muse::Dl::Errors::MuseCorruptPDF.new("Error: MUSE is unable to generate PDF for #{url}")
end end
end end
end end
@ -95,10 +95,10 @@ module Muse::Dl
return Muse::Dl::Journal.new response return Muse::Dl::Journal.new response
end end
rescue ex : Crest::NotFound rescue ex : Crest::NotFound
raise Muse::Dl::Errors::InvalidLink.new raise Muse::Dl::Errors::InvalidLink.new("Error - could not download url: #{url}")
end end
else else
raise Muse::Dl::Errors::InvalidLink.new raise Muse::Dl::Errors::InvalidLink.new("Error - url does not match expected pattern: #{url}")
end end
end end
end end