File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 1818)
1919
2020import aiohttp
21+ from aiohttp .web import HTTPNotFound
2122from aleph_message import parse_message
2223from aleph_message .models import AlephMessage , ItemHash , ItemType
2324from aleph_message .status import MessageStatus
@@ -463,12 +464,6 @@ async def get_program_price(self, item_hash: str) -> PriceResponse:
463464 async def get_message_status (self , item_hash : str ) -> MessageStatus :
464465 """return Status of a message"""
465466 async with self .http_session .get (f"/api/v0/messages/{ item_hash } " ) as resp :
466- try :
467- resp .raise_for_status ()
468- except aiohttp .ClientResponseError as e :
469- if e .status == 404 :
470- raise MessageNotFoundError (f"No such hash { item_hash } " )
471- raise e
472-
473- message_raw = await resp .json ()
474- return MessageStatus (message_raw ["status" ])
467+ if resp .status == HTTPNotFound .status_code :
468+ raise MessageNotFoundError (f"No such hash { item_hash } " )
469+ resp .raise_for_status ()
You can’t perform that action at this time.
0 commit comments