AWS Cognito中的UpdateUserAttributes何时可以引发CodeMismatchException或ExpiredCodeException?

AWS Cognito中的UpdateUserAttributes何时可以引发CodeMismatchException或ExpiredCodeException?,exception,amazon-cognito,Exception,Amazon Cognito,我正在这里查看UpdateUserAttribute的文档: 错误部分列出了UpdateUserAttribute引发的可能异常CodeMismatchException和ExpiredCodeException。我很困惑,因为据我所知,UpdateUserAttribute不接受验证代码作为参数 我的理解是,如果我需要验证更新的属性(如电子邮件),那么在UpdateUserAttributes成功返回后,Cognito会将验证代码发送到新的电子邮件。然后,我将使用验证代码调用VerifyUse

我正在这里查看UpdateUserAttribute的文档:

错误部分列出了UpdateUserAttribute引发的可能异常CodeMismatchException和ExpiredCodeException。我很困惑,因为据我所知,UpdateUserAttribute不接受验证代码作为参数

我的理解是,如果我需要验证更新的属性(如电子邮件),那么在UpdateUserAttributes成功返回后,Cognito会将验证代码发送到新的电子邮件。然后,我将使用验证代码调用VerifyUserAttribute来验证该属性。可以理解,VerifyUserAttribute可能引发CodeMismatchException或ExpiredCodeException

这就引出了标题中的问题:鉴于UpdateUserAttributes不处理验证代码,在什么情况下UpdateUserAttributes可以抛出CodeMismatchException或ExpiredCodeException?我是否误解了UpdateUserAttribute如何工作的基本原理