17 lines
387 B
Python
17 lines
387 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
自定义异常类
|
|
"""
|
|
|
|
class StalwartError(Exception):
|
|
"""Stalwart 相关错误的基类"""
|
|
pass
|
|
|
|
class ApiError(StalwartError):
|
|
"""API 调用错误"""
|
|
def __init__(self, message, status_code=None, response=None):
|
|
super().__init__(message)
|
|
self.status_code = status_code
|
|
self.response = response |