Skip to content

Commit

Permalink
✨ feat(utils): Update pyproject.toml to version 0.1.6 and handle
Browse files Browse the repository at this point in the history
generic exception in json decoding
  • Loading branch information
sudoskys committed Jan 30, 2024
1 parent b7e56e7 commit e76a929
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/novelai_python/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import json
from typing import Union

from loguru import logger

from .hash import NovelAiMetadata


Expand All @@ -29,4 +31,5 @@ def try_jsonfy(obj: Union[str, dict, list, tuple]):
try:
return json.loads(obj)
except Exception:
logger.error(f"Decode Error {obj}")
return f"Decode Error {type(obj)}"

0 comments on commit e76a929

Please sign in to comment.