Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.gecko.sync;
7 import android.content.SyncResult;
9 /**
10 * There was a problem with the Sync account's credentials: bad username,
11 * missing password, malformed sync key, etc.
12 */
13 public abstract class CredentialException extends SyncException {
14 private static final long serialVersionUID = 833010553314100538L;
16 public CredentialException() {
17 super();
18 }
20 public CredentialException(final Throwable e) {
21 super(e);
22 }
24 public void updateStats(GlobalSession globalSession, SyncResult syncResult) {
25 syncResult.stats.numAuthExceptions += 1;
26 }
28 /**
29 * No credentials at all.
30 */
31 public static class MissingAllCredentialsException extends CredentialException {
32 private static final long serialVersionUID = 3763937096217604611L;
34 public MissingAllCredentialsException() {
35 super();
36 }
38 public MissingAllCredentialsException(final Throwable e) {
39 super(e);
40 }
41 }
43 /**
44 * Some credential is missing.
45 */
46 public static class MissingCredentialException extends CredentialException {
47 private static final long serialVersionUID = -7543031216547596248L;
49 public final String missingCredential;
51 public MissingCredentialException(final String missingCredential) {
52 this.missingCredential = missingCredential;
53 }
54 }
55 }