I'm using Pubnub JS and need to handle subscribe request fails like 400 403 etc
addListener method don't have such option to handle error
I'm using Pubnub JS and need to handle subscribe request fails like 400 403 etc
addListener method don't have such option to handle error
You want to listen for status events and filter by category, i.e.:
For a list of categories, see https://www.pubnub.com/docs/sdks/javascript/api-reference/configuration#listener-status-events. I'm not sure how they map to the specific 4xx error codes but there is a dedicated PNUnknownCategory for non-200 responses.