MCPcopy Create free account
hub / github.com/HiddenCodeDevs/BlumTelegramBot / error_wrapper

Method error_wrapper

bot/core/api.py:32–43  ·  view source on GitHub ↗
(method)

Source from the content-addressed store, hash-verified

30
31 @staticmethod
32 def error_wrapper(method):
33 async def wrapper(self, *arg, **kwargs):
34 try:
35 return await method(self, *arg, **kwargs)
36 except NeedRefreshTokenError:
37 await self.refresh_tokens()
38 return await method(self, *arg, **kwargs)
39 except NeedReLoginError:
40 raise NeedReLoginError
41 except Exception as e:
42 self._log.error(f"Error on BlumApi.{method.__name__} | {type(e).__name__}: {e}")
43 return wrapper
44
45 async def get(self, url: str):
46 option_headers = {"access-control-request-method": "GET", **self._session.headers}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected