Getting Exception while stopping push subscription


#1

I’m trying to stop a push subscription with below code and i keep getting Exception although the subscription id is valid. This also occurs even if you use your console.

org.datasift.EAPIError: Bad request,Cannot stop the subscription
at org.datasift.User.callAPI(Unknown Source)
at org.datasift.PushSubscription.stop(Unknown Source)

public static void stopPushSubscription(String subscriptionId) {
User user = new User(, );
PushSubscription ps;
try {
ps = user.getPushSubscription(subscriptionId);
if(ps != null) {
ps.stop();
}
} catch (EAPIError e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (EAccessDenied e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (EInvalidData e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}


#2

This is my bug…ignore it.