def rest_error(message:str="Unknow", code:str="0", error_id:str=""):
"""
Build the REST error response
:param message: The short "friendly user" error message
:param code: The code of the error type
:param error_id: The id of the error, to return to the end-user.
This code will allow admins to find in logs where exactly this error occure
"""
results = {
"success": False,
"msg": message,
"error_code": code,
"error_url": code,
"error_id": error_id
}
return web.json_response(results)
评论列表
文章目录