AWS“手册”说:
// Callback handler for confirmSignUp API
GenericHandler confirmationCallback = new GenericHandler() {
@Override
public void onSuccess() {
// User was successfully confirmed
}
@Override
public void onFailure(Exception exception) {
// User confirmation failed. Check exception for the cause.
}
};
如何“检查”异常?我应该将其消息与一些魔术文字进行比较以了解错误是什么,还是应该使用类似以下代码:
exception.getClass().isInstance(CognitoNotAuthorizedException.class);
?