forked from DGNum/uptime-kuma-api
Compare commits
2 commits
master
...
Zerka30/re
Author | SHA1 | Date | |
---|---|---|---|
|
d56ffcc774 | ||
|
91ad893223 |
1 changed files with 5 additions and 2 deletions
|
@ -500,13 +500,16 @@ class UptimeKumaApi(object):
|
|||
return deepcopy(self._event_data[event].copy())
|
||||
|
||||
def _call(self, event, data=None) -> Any:
|
||||
r = self.sio.call(event, data, timeout=self.timeout)
|
||||
try:
|
||||
r = self.sio.call(event, data, timeout=self.timeout)
|
||||
except socketio.exceptions.TimeoutError:
|
||||
raise Timeout(f"Timed out while waiting for event {event}")
|
||||
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