From 5136994dd331ab4efc47684f98b3fa50f8c8734b Mon Sep 17 00:00:00 2001 From: Kurbanov Bulat Date: Sun, 9 Jan 2022 00:06:43 +0300 Subject: [PATCH] Fix converter using --- src/app/services/fl_downloader.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/services/fl_downloader.py b/src/app/services/fl_downloader.py index b5c31c1..1590827 100644 --- a/src/app/services/fl_downloader.py +++ b/src/app/services/fl_downloader.py @@ -17,6 +17,10 @@ class ReceivedHTML(Exception): pass +class ConvertationError(Exception): + pass + + class FLDownloader(BaseDownloader): def __init__(self, book_id: int, file_type: str, source_id: int): self.book_id = book_id @@ -98,7 +102,7 @@ class FLDownloader(BaseDownloader): p_task.cancel() return data - except (NotSuccess, ReceivedHTML): + except (NotSuccess, ReceivedHTML, ConvertationError): continue tasks_ = pending @@ -133,7 +137,7 @@ class FLDownloader(BaseDownloader): ) if response.status_code != 200: - raise ValueError + raise ConvertationError return content, False