Files
wecom-wnzs-adapter/service/wecom/exceptions/general.py
2026-01-15 17:34:22 +08:00

15 lines
482 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
class SDKException(Exception):
def __init__(self, errcode: int, message: str):
"""
通用错误返回类,用于抛出请求错误时的异常
- 若请求返回的errcode不为0则抛出此异常
@param errcode: 错误码
@param message: 错误信息
"""
self.errcode = str(errcode)
self.message = message
def __str__(self):
return f"Error Occured: {self.errcode} - {self.message}"