mobile/android/base/sync/SyncException.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/sync/SyncException.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +package org.mozilla.gecko.sync;
     1.9 +
    1.10 +import android.content.SyncResult;
    1.11 +
    1.12 +public abstract class SyncException extends Exception {
    1.13 +  private static final long serialVersionUID = -6928990004393234738L;
    1.14 +
    1.15 +  public SyncException() {
    1.16 +    super();
    1.17 +  }
    1.18 +
    1.19 +  public SyncException(final Throwable e) {
    1.20 +    super(e);
    1.21 +  }
    1.22 +
    1.23 +  /**
    1.24 +   * Update sync result statistics with information particular to this
    1.25 +   * exception.
    1.26 +   *
    1.27 +   * @param globalSession
    1.28 +   *          current session, or null.
    1.29 +   * @param syncResult
    1.30 +   *          Android sync result to update.
    1.31 +   */
    1.32 +  public void updateStats(GlobalSession globalSession, SyncResult syncResult) {
    1.33 +    // Assume storage error.
    1.34 +    // TODO: this logic is overly simplistic.
    1.35 +    syncResult.databaseError = true;
    1.36 +  }
    1.37 +}

mercurial