Skip to content

Commit

Permalink
Fix logging (#39)
Browse files Browse the repository at this point in the history
* Fix empty error logs

* Bump version 0.3.6

* Add poetry-lock-check
  • Loading branch information
evgeny-stakewise authored Jun 12, 2023
1 parent 345f29e commit e7356b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,13 @@ repos:
language: system
types: [ python ]
require_serial: true

- repo: local
hooks:
- id: poetry-lock-check
name: poetry lock check
entry: poetry
language: system
files: no-files
args: ["lock", "--check"]
always_run: true
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sw-utils"
version = "0.3.5"
version = "0.3.6"
description = "StakeWise Python utils"
authors = ["StakeWise Labs <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down
8 changes: 4 additions & 4 deletions sw_utils/ipfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async def _upload(self, coros: list) -> str:
ipfs_hashes: dict[str, int] = {}
for value in result:
if isinstance(value, BaseException):
logger.error(value)
logger.error(repr(value))
continue

ipfs_hash = _strip_ipfs_prefix(value)
Expand All @@ -236,7 +236,7 @@ async def remove(self, ipfs_hash: str) -> None:
)
for value in result:
if isinstance(value, BaseException):
logger.error(value)
logger.error(repr(value))
continue
return None

Expand All @@ -262,7 +262,7 @@ async def fetch_bytes(self, ipfs_hash: str) -> bytes:

return self._ipfs_fetch_bytes(endpoint, ipfs_hash)
except Exception as e:
logger.error(e)
logger.error(repr(e))

raise IpfsException(f'Failed to fetch IPFS data at {ipfs_hash}')

Expand Down Expand Up @@ -293,7 +293,7 @@ async def fetch_json(self, ipfs_hash: str) -> dict | list:

return self._ipfs_fetch_json(endpoint, ipfs_hash)
except Exception as e:
logger.error(e)
logger.error(repr(e))

raise IpfsException(f'Failed to fetch IPFS data at {ipfs_hash}')

Expand Down

0 comments on commit e7356b0

Please sign in to comment.