handlers.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Pirus 作者: REGOVAR 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号