From cf701d4a097f615f0255f6fd4f06fdc8ddeb184a Mon Sep 17 00:00:00 2001 From: geremy Date: Tue, 9 Jul 2013 21:20:56 -0700 Subject: [PATCH] Adding comments for auth in subscribe errorCallback --- .../pubnub/examples/PubnubDemoConsole.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java b/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java index 8d000d7ec..5e1279573 100644 --- a/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java +++ b/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java @@ -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 { @@ -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()); }