Skip to content

Commit

Permalink
Adding comments for auth in subscribe errorCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
geremy committed Jul 10, 2013
1 parent c555643 commit cf701d4
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions java/examples/src/com/pubnub/examples/PubnubDemoConsole.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.pubnub.examples;

import java.util.Hashtable;
import java.util.Scanner;

import com.pubnub.api.*;
import org.json.JSONArray;
import org.json.JSONObject;

import com.pubnub.api.*;
import java.util.Hashtable;
import java.util.Scanner;

import static java.lang.System.out;

public class PubnubDemoConsole {
Expand Down Expand Up @@ -126,6 +126,21 @@ public void successCallback(String channel, Object message) {

@Override
public void errorCallback(String channel, PubnubError error) {

/*
# Switch on error code, see PubnubError.java
if (error.errorCode == 112) {
# Bad Auth Key!
unsubscribe, get a new auth key, subscribe, etc...
} else if (error.errorCode == 113) {
# Need to set Auth Key !
unsubscribe, set auth, resubscribe
}
*/

notifyUser("SUBSCRIBE : ERROR on channel " + channel
+ " : " + error.toString());
}
Expand Down

0 comments on commit cf701d4

Please sign in to comment.