michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.sync; michael@0: michael@0: import android.content.SyncResult; michael@0: michael@0: /** michael@0: * There was a problem with the Sync account's credentials: bad username, michael@0: * missing password, malformed sync key, etc. michael@0: */ michael@0: public abstract class CredentialException extends SyncException { michael@0: private static final long serialVersionUID = 833010553314100538L; michael@0: michael@0: public CredentialException() { michael@0: super(); michael@0: } michael@0: michael@0: public CredentialException(final Throwable e) { michael@0: super(e); michael@0: } michael@0: michael@0: public void updateStats(GlobalSession globalSession, SyncResult syncResult) { michael@0: syncResult.stats.numAuthExceptions += 1; michael@0: } michael@0: michael@0: /** michael@0: * No credentials at all. michael@0: */ michael@0: public static class MissingAllCredentialsException extends CredentialException { michael@0: private static final long serialVersionUID = 3763937096217604611L; michael@0: michael@0: public MissingAllCredentialsException() { michael@0: super(); michael@0: } michael@0: michael@0: public MissingAllCredentialsException(final Throwable e) { michael@0: super(e); michael@0: } michael@0: } michael@0: michael@0: /** michael@0: * Some credential is missing. michael@0: */ michael@0: public static class MissingCredentialException extends CredentialException { michael@0: private static final long serialVersionUID = -7543031216547596248L; michael@0: michael@0: public final String missingCredential; michael@0: michael@0: public MissingCredentialException(final String missingCredential) { michael@0: this.missingCredential = missingCredential; michael@0: } michael@0: } michael@0: }