summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2008-12-08 18:54:26 -0800
committerShawn O. Pearce <sop@google.com>2008-12-08 18:54:26 -0800
commit4f5706fc6b3322bb4c76c9d9f6127f9f6d8d056f (patch)
treec7ea22f0b901acbdcb4bbb81690b76a72f9fdddd /webapp
parentc6b0961e7396a454be741909d32f98a82d891fc2 (diff)
Handle NotSignedIn errors gracefully during module load
If we get back a NotSignedIn exception we should whack the cookie that lead us to believe we might be signed in, and not log error. This fix really only matters in the hosted debug console, where the error is somewhat common if you reinitialize your data store. Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/com/google/gerrit/client/Gerrit.java5
-rw-r--r--webapp/src/com/google/gerrit/client/rpc/GerritCallback.java4
2 files changed, 6 insertions, 3 deletions
diff --git a/webapp/src/com/google/gerrit/client/Gerrit.java b/webapp/src/com/google/gerrit/client/Gerrit.java
index e8be073c0f..98a7f3cfee 100644
--- a/webapp/src/com/google/gerrit/client/Gerrit.java
+++ b/webapp/src/com/google/gerrit/client/Gerrit.java
@@ -194,7 +194,10 @@ public class Gerrit implements EntryPoint {
}
public void onFailure(final Throwable caught) {
- GWT.log("Unexpected failure from validating account", caught);
+ if (!GWT.isScript() && !GerritCallback.isNotSignedIn(caught)) {
+ GWT.log("Unexpected failure from validating account", caught);
+ }
+ Cookies.removeCookie(ACCOUNT_COOKIE);
refreshMenuBar();
showInitialScreen();
}
diff --git a/webapp/src/com/google/gerrit/client/rpc/GerritCallback.java b/webapp/src/com/google/gerrit/client/rpc/GerritCallback.java
index 45af9eab23..603b745f42 100644
--- a/webapp/src/com/google/gerrit/client/rpc/GerritCallback.java
+++ b/webapp/src/com/google/gerrit/client/rpc/GerritCallback.java
@@ -39,7 +39,7 @@ public abstract class GerritCallback<T> implements AsyncCallback<T> {
}
}
- private static boolean isNotSignedIn(final Throwable caught) {
+ public static boolean isNotSignedIn(final Throwable caught) {
if (caught instanceof NotSignedInException) {
return true;
}
@@ -47,7 +47,7 @@ public abstract class GerritCallback<T> implements AsyncCallback<T> {
&& caught.getMessage().equals(NotSignedInException.MESSAGE);
}
- protected static boolean isNoSuchEntity(final Throwable caught) {
+ public static boolean isNoSuchEntity(final Throwable caught) {
if (caught instanceof NoSuchEntityException) {
return true;
}