mongoengine.NotUniqueError

 

 

 from mongoengine.errors import NotUniqueError
    try:
        pass  # 保存字段到数据库
        result = formalReturn(201, 'upload success', data=None)
        return jsonify(result), 201
    except NotUniqueError as e:
        result = formalReturn(40001, 'file already exists', data=str(e))
    except Exception as e:
        result = formalReturn(40004, 'unexpected error', data=str(e))

  

posted @ 2019-04-24 11:44  Adamanter  阅读(349)  评论(0编辑  收藏  举报