简体   繁体   English

如何处理Quickblox iOS SDK中的错误?

[英]How to handle errors from Quickblox iOS SDK?

I got this message from quickblox ios sdk, 我从quickblox ios sdk收到此消息,

{
    errors =     {
        email =         (
            "has already been taken"
        );
    };
}

I'm not sure how to handle error with quickblox? 我不确定如何使用quickblox处理错误? Is there a list of error messages that I can by forget the issue? 是否存在错误消息列表,我可以忘记该问题? I got to print this message with help of QBResponse object like this, 我得在这样的QBResponse对象的帮助下打印此消息,

NSLog(@"%@",response.error.reasons); 

Here reason is a NSDictionary , how do I know which error message key is inside? 这里的原因是NSDictionary ,我怎么知道里面有哪个错误信息键?

At the same time, I got this message Expected status code in (200-299), got 422 for NSLog(@"%@",response.error.error.localizedDescription); 同时,我收到此消息预期状态代码在(200-299),得到422为NSLog(@"%@",response.error.error.localizedDescription);

You should check localizedRecoverySuggestion at first, if nil is there, than you should look for reasons dictionary. 你应该首先检查一下localizedRecoverySuggestion,如果是存在的,不是你应该寻找原因字典。 Unfortunately there are no standard keys that you could expect. 不幸的是,没有你可以期待的标准密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM