From 1d95cce3f8a4314e5fcb2986b4b7022adc1a09d6 Mon Sep 17 00:00:00 2001 From: Nemo Date: Sun, 5 Apr 2020 02:14:50 +0530 Subject: [PATCH] Catch another PDF error --- src/fetch.cr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fetch.cr b/src/fetch.cr index 524afef..58b69a0 100644 --- a/src/fetch.cr +++ b/src/fetch.cr @@ -49,7 +49,10 @@ module Muse::Dl if /html/.match content_type puts response response.body_io.each_line do |line| - if /Unable to construct chapter PDF/.match line + # https://muse.jhu.edu/chapter/2383438/pdf + # https://muse.jhu.edu/book/67393 + # Errors are Unable to determine page runs / Unable to construct chapter PDF + if /Unable to/.match line raise Muse::Dl::Errors::MuseCorruptPDF.new end end