Aws-sdk-ios: AWSSNS is not able to handle errors properly

Created on 24 Apr 2017  路  3Comments  路  Source: aws-amplify/aws-sdk-ios

  • What service are you using?
    AWSSNS
  • In what version of SDK are you facing the problem?
    2.5.2,2.5.3
  • Is the issue limited to Simulators / Actual Devices?
    Only the actual device(Because AWSSNS doesn't work on Simulator)
  • Can your problem be resolved if you bump to a higher version of SDK?
    No
  • Is this problem related to specific iOS version?
    No
  • How are you consuming the SDK? CocoaPods / Carthage / Prebuilt frameworks?
    Tried Prebuilt frameworks and CocoaPods.
  • Can you give us steps to reproduce with a minimal, complete, and verifiable example? Please include any specific network conditions that might be required to reproduce the problem.

When receiving an error response from SNS, NSError.code is always AWSSNSErrorUnknown and userInfo is nil.
It's probably because the code of error handling changed in 2.4.8.
https://github.com/aws/aws-sdk-ios/blob/master/AWSSNS/AWSSNSService.m#L68
The format of the error response received here is as follows

<ErrorResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
  <Error>
    <Type>Sender</Type>
    <Code>InvalidParameter</Code>
    <Message>Invalid parameter: Token Reason: Endpoint arn:aws:sns:... already exists with the same Token, but different attributes.</Message>
  </Error>
  <RequestId>...</RequestId>
</ErrorResponse>

If the code is 2.4.7 or earlier, error information is successfully acquired.

bug

All 3 comments

Thanks we will fix this in the next release

Fixed with 2.5.6.

Thanks,
Rohan

I tried 2.5.6, but nothing seems to be changed.
Would you please check it again.
@karthiksaligrama @rohandubal

Was this page helpful?
0 / 5 - 0 ratings