|
@@ -1,8 +1,13 @@
|
|
|
#!/usr/bin/env python3
|
|
|
# encoding:utf-8
|
|
|
+from src.core.callcenter.enumeration import BizErrorCode
|
|
|
+
|
|
|
|
|
|
class BizException(Exception):
|
|
|
def __init__(self, message, status_code=400):
|
|
|
+ if isinstance(message, BizErrorCode):
|
|
|
+ message = message.value
|
|
|
+ status_code = message.code
|
|
|
super().__init__(message)
|
|
|
self.message = message
|
|
|
self.status_code = status_code
|