Skip to content

Commit cf701d4

Browse files
author
geremy
committed
Adding comments for auth in subscribe errorCallback
1 parent c555643 commit cf701d4

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

‎java/examples/src/com/pubnub/examples/PubnubDemoConsole.java‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.pubnub.examples;
22

3-
import java.util.Hashtable;
4-
import java.util.Scanner;
5-
3+
import com.pubnub.api.*;
64
import org.json.JSONArray;
75
import org.json.JSONObject;
86

9-
import com.pubnub.api.*;
7+
import java.util.Hashtable;
8+
import java.util.Scanner;
9+
1010
import static java.lang.System.out;
1111

1212
public class PubnubDemoConsole {
@@ -126,6 +126,21 @@ public void successCallback(String channel, Object message) {
126126

127127
@Override
128128
public void errorCallback(String channel, PubnubError error) {
129+
130+
/*
131+
132+
# Switch on error code, see PubnubError.java
133+
134+
if (error.errorCode == 112) {
135+
# Bad Auth Key!
136+
unsubscribe, get a new auth key, subscribe, etc...
137+
} else if (error.errorCode == 113) {
138+
# Need to set Auth Key !
139+
unsubscribe, set auth, resubscribe
140+
}
141+
142+
*/
143+
129144
notifyUser("SUBSCRIBE : ERROR on channel " + channel
130145
+ " : " + error.toString());
131146
}

0 commit comments

Comments
 (0)