exception.py 465 Bytes
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
框架异常类
"""


class AuthenticationError(Exception):
    """
    未认证
    """

    def __init__(self, detail: str = "Unauthorized"):
        self.detail = detail


class AuthorizationError(Exception):
    """
    未授权
    """

    def __init__(self, detail: str = "Forbidden"):
        self.detail = detail

class AppError(Exception):
    """
    应用错误
    """

    def __init__(self, detail: str = "error"):
        self.detail = detail