如何处理onFailure回调中的AWS异常错误

时间:2019-01-24 16:09:16

标签: android amazon-web-services

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);

0 个答案:

没有答案