- sync_wework: 企业微信通讯录同步模块 - wework_server: 企业微信回调服务(Flask) - appconfig/config_wiki: wiki应用配置 - exceptions: 增强异常处理 Co-Authored-By: Claude Opus 4.7 <[email protected]>
30 lines
726 B
Python
30 lines
726 B
Python
"""AIBridge 异常体系"""
|
|
|
|
|
|
class JNPFError(Exception):
|
|
"""基础异常"""
|
|
def __init__(self, msg=None, code=None, raw=None):
|
|
super().__init__(msg)
|
|
self.msg = msg
|
|
self.code = code
|
|
self.raw = raw
|
|
|
|
|
|
class AuthError(JNPFError):
|
|
"""认证异常(登录失败、Token失效等)"""
|
|
|
|
def __init__(self, msg=None, code=None, raw=None):
|
|
super().__init__(msg)
|
|
self.msg = msg
|
|
self.code = code
|
|
self.raw = raw
|
|
|
|
|
|
class APIError(JNPFError):
|
|
"""API 调用异常(请求失败、参数错误等)"""
|
|
|
|
def __init__(self, message, code=None, response=None):
|
|
super().__init__(message)
|
|
self.code = code
|
|
self.response = response
|