Skip to content

Commit

Permalink
Fix: Response was processed even in case of error status code
Browse files Browse the repository at this point in the history
Solution: Call `raise_for_status` before parsing and returning the response data.
  • Loading branch information
hoh committed Feb 12, 2024
1 parent ad9419e commit 7b70409
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/aleph/services/ipfs/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ async def add_file(self, fileobject: IO):
data.add_field("path", fileobject)

resp = await session.post(url, data=data)
resp.raise_for_status()
return await resp.json()

async def sub(self, topic: str):
Expand Down

0 comments on commit 7b70409

Please sign in to comment.