I am calling the unsubscribe API of AWS using a subscription ARN as in the below code.
UnsubscribeRequest request = new UnsubscribeRequest(subscriptionArn);
UnsubscribeResult result = sns.unsubscribe(request);
System.out.println("UnsubscribeResult - " + result.getSdkResponseMetadata().toString());
System.out.println("UnsubscribeResult - " + result.getSdkHttpMetadata().getHttpStatusCode());
I am able to retrieve HTTP status code as 200 for successful API hit. For a few error cases, exception is thrown which is already taken care of. But I wanted to handle failure responses for all other scenarios. But I receive the same response metadata and HTTP status code for an invalid subscription ARN.
Thanks in Advance.