forked from Lesin/reposync
refactor: 将ErrorTemplate中的方法改为静态方法
This commit is contained in:
parent
50e3259693
commit
f4ccd13dc1
|
@ -16,11 +16,14 @@ class Errors:
|
|||
|
||||
class ErrorTemplate:
|
||||
|
||||
def ARGUMENT_LACK(did): return HTTPException(
|
||||
Code.NOT_FOUND, '参数[%s]不能为空' % did)
|
||||
@staticmethod
|
||||
def ARGUMENT_LACK(did: str = "参数") -> HTTPException:
|
||||
return HTTPException(Code.NOT_FOUND, '参数[%s]不能为空' % did)
|
||||
|
||||
def ARGUMENT_ERROR(did): return HTTPException(
|
||||
Code.NOT_FOUND, '参数[%s]有错' % did)
|
||||
@staticmethod
|
||||
def ARGUMENT_ERROR(did: str = "参数") -> HTTPException:
|
||||
return HTTPException(Code.NOT_FOUND, '参数[%s]有错' % did)
|
||||
|
||||
def TIP_ARGUMENT_ERROR(did): return HTTPException(
|
||||
Code.NOT_FOUND, '请输入正确的%s地址' % did)
|
||||
@staticmethod
|
||||
def TIP_ARGUMENT_ERROR(did: str = "链接") -> HTTPException:
|
||||
return HTTPException(Code.NOT_FOUND, '请输入正确的%s地址' % did)
|
Loading…
Reference in New Issue