🐛 (api.py): Fix to work has expected
This commit is contained in:
parent
91ad893223
commit
d56ffcc774
1 changed files with 5 additions and 5 deletions
|
@ -502,14 +502,14 @@ class UptimeKumaApi(object):
|
|||
def _call(self, event, data=None) -> Any:
|
||||
try:
|
||||
r = self.sio.call(event, data, timeout=self.timeout)
|
||||
r.pop("ok")
|
||||
except socketio.exceptions.TimeoutError:
|
||||
raise Timeout(f"Timed out while waiting for event {event}")
|
||||
except Exception as e:
|
||||
raise UptimeKumaException(r.get("msg"))
|
||||
|
||||
if isinstance(r, dict) and "ok" in r:
|
||||
if not r["ok"]:
|
||||
raise UptimeKumaException(r.get("msg"))
|
||||
r.pop("ok")
|
||||
return r
|
||||
|
||||
|
||||
# event handlers
|
||||
|
||||
def _event_connect(self) -> None:
|
||||
|
|
Loading…
Reference in a new issue