🎨 Improve BadRequest

This commit is contained in:
洛水居室 2023-06-12 10:09:03 +08:00
parent ee385fea98
commit f5664c7de0
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -63,6 +63,10 @@ class BadRequest(ApiHelperException):
def response(self) -> dict[str, Union[str, Any, None]]: def response(self) -> dict[str, Union[str, Any, None]]:
return {"retcode": self.ret_code, "message": self.original} return {"retcode": self.ret_code, "message": self.original}
@property
def retcode(self) -> int:
return self.ret_code
class InternalDatabaseError(BadRequest): class InternalDatabaseError(BadRequest):
"""Internal database error.""" """Internal database error."""