【发布时间】:2018-05-17 04:30:26
【问题描述】:
处理此错误的正确方法是什么?我创建了两个堆栈问题,两个答案都不再起作用。这是我的代码:
from firebase_admin import auth as admin_auth
try:
uid = 'testUID'
email = 'test@test.com' # test@test.com already exists
admin_auth.update_user(uid, email=email)
except Exception as e:
print(e)
我收到以下回复:
Failed to update user: testUID. Server response: { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "EMAIL_EXISTS" } ], "code": 400, "message": "EMAIL_EXISTS" } }
我是否正确地创建了异常?如果我使用:
except ValueError as e:
我得到一个字符串的响应。我想要的是获取状态/代码和消息。
【问题讨论】:
-
你解决了吗?
-
Nope 刚刚创建了特殊错误。永远无法解析响应
标签: python firebase firebase-authentication