summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/hircine/api/inputs.py8
-rw-r--r--src/hircine/plugins/scrapers/ehentai_api.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/hircine/api/inputs.py b/src/hircine/api/inputs.py
index c88bcce..a9cf272 100644
--- a/src/hircine/api/inputs.py
+++ b/src/hircine/api/inputs.py
@@ -277,13 +277,13 @@ class ComicTagsUpdateInput(UpdateInputList):
def parse_input(cls, id):
try:
return [int(i) for i in id.split(":")]
- except ValueError:
+ except ValueError as err:
raise APIException(
InvalidParameterError(
parameter="id",
text="ComicTag ID must be specified as <namespace_id>:<tag_id>",
)
- )
+ ) from err
@classmethod
async def get_from_ids(cls, ids, ctx: MutationContext):
@@ -383,13 +383,13 @@ class ComicTagsUpsertInput(UpsertInputList):
raise ValueError()
return namespace, tag
- except ValueError:
+ except ValueError as err:
raise APIException(
InvalidParameterError(
parameter="name",
text="ComicTag name must be specified as <namespace>:<tag>",
)
- )
+ ) from err
@classmethod
async def get_from_names(cls, input, ctx: MutationContext, on_missing: OnMissing):
diff --git a/src/hircine/plugins/scrapers/ehentai_api.py b/src/hircine/plugins/scrapers/ehentai_api.py
index 70fcf57..3720b92 100644
--- a/src/hircine/plugins/scrapers/ehentai_api.py
+++ b/src/hircine/plugins/scrapers/ehentai_api.py
@@ -69,7 +69,7 @@ class EHentaiAPIScraper(Scraper):
handler = ExHentaiHandler()
yield from handler.scrape(response)
- except json.JSONDecodeError:
- raise ScrapeError("Could not parse JSON response")
+ except json.JSONDecodeError as err:
+ raise ScrapeError("Could not parse JSON response") from err
else:
raise ScrapeError(f"Request failed with status code {request.status_code}'")