新增 Zalo OA、Zoom Chat、Zulip 三个渠道扩展。 Zalo OA 渠道扩展主要模块:sidecar_client, config, gateway, outbound, streaming, pairing, security, auth, dedupe, directory, monitor, status, session, reactions, tools Zoom Chat 渠道扩展主要模块:config, gateway, webhook, outbound, streaming, pairing, security, crypto, dedupe, actions, media, mentions, monitor, status, session, reactions, threading Zulip 渠道扩展主要模块:client, config, gateway, outbound, streaming, pairing, security, monitor, status
27 lines
594 B
Python
27 lines
594 B
Python
from __future__ import annotations
|
|
|
|
|
|
class ZulipError(Exception):
|
|
pass
|
|
|
|
|
|
class ZulipAPIError(ZulipError):
|
|
def __init__(self, status_code: int, response_data: dict):
|
|
self.status_code = status_code
|
|
self.response_data = response_data
|
|
self.code = response_data.get("code", "")
|
|
self.msg = response_data.get("msg", "")
|
|
super().__init__(f"Zulip API error ({status_code}): {self.code} - {self.msg}")
|
|
|
|
|
|
class ZulipAuthError(ZulipError):
|
|
pass
|
|
|
|
|
|
class ZulipQueueExpiredError(ZulipAPIError):
|
|
pass
|
|
|
|
|
|
class ZulipRateLimitError(ZulipAPIError):
|
|
pass
|