Merge branch 'refactor/backend-architecture' into development
This commit is contained in:
28
api/app/features/payment/payment_exceptions.py
Normal file
28
api/app/features/payment/payment_exceptions.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""支付模块异常定义(从 payment 迁入 app)"""
|
||||
|
||||
|
||||
class PaymentError(Exception):
|
||||
def __init__(self, message: str = "支付异常", code: str = "PAYMENT_ERROR"):
|
||||
self.message = message
|
||||
self.code = code
|
||||
super().__init__(self.message)
|
||||
|
||||
|
||||
class PaymentConfigError(PaymentError):
|
||||
def __init__(self, message: str = "支付配置错误"):
|
||||
super().__init__(message=message, code="PAYMENT_CONFIG_ERROR")
|
||||
|
||||
|
||||
class PaymentCreateError(PaymentError):
|
||||
def __init__(self, message: str = "创建支付订单失败"):
|
||||
super().__init__(message=message, code="PAYMENT_CREATE_ERROR")
|
||||
|
||||
|
||||
class PaymentNotifyError(PaymentError):
|
||||
def __init__(self, message: str = "支付回调处理失败"):
|
||||
super().__init__(message=message, code="PAYMENT_NOTIFY_ERROR")
|
||||
|
||||
|
||||
class PaymentQueryError(PaymentError):
|
||||
def __init__(self, message: str = "查询支付状态失败"):
|
||||
super().__init__(message=message, code="PAYMENT_QUERY_ERROR")
|
||||
Reference in New Issue
Block a user