Repos / pytaku / 990ea70bcf
commit 990ea70bcf616e1ad7a2922b853db9b32611e66a
Author: Bùi Thành Nhân <hi@imnhan.com>
Date: Tue Mar 23 21:52:54 2021 +0700
catch JsonDecodeError in title updater
diff --git a/pyproject.toml b/pyproject.toml
index de0b1f2..27637eb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pytaku"
-version = "0.4.1"
+version = "0.4.2"
description = "Self-hostable web-based manga reader"
authors = ["Bùi Thành Nhân <hi@imnhan.com>"]
license = "AGPL-3.0-only"
diff --git a/src/pytaku/scheduler.py b/src/pytaku/scheduler.py
index c64cb21..aa24b34 100644
--- a/src/pytaku/scheduler.py
+++ b/src/pytaku/scheduler.py
@@ -2,6 +2,7 @@
import traceback
from abc import ABC, abstractmethod
from datetime import datetime, timedelta
+from json.decoder import JSONDecodeError
from pathlib import Path
from requests.exceptions import ReadTimeout
@@ -69,8 +70,8 @@ def run(self):
updated_title = get_title(title["site"], title["id"])
save_title(updated_title)
print(" done")
- except (SourceSite5xxError, ReadTimeout) as e:
- print(" skipped because of server error:", str(e))
+ except (SourceSite5xxError, ReadTimeout, JSONDecodeError) as e:
+ print(" skipped because of server error:", e.__class__.__name__, str(e))
class DeleteExpiredTokens(Worker):