Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: sync/android/java/src/org/chromium/sync/signin/AuthException.java

Issue 1440363002: Use GoogleAuthUtil's getToken instead of AccountManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.sync.signin;
6
7 import android.content.Intent;
8
9 /*
10 * AuthException abstracts away authenticator specific exceptions behind a singl e interface.
11 * It is used for passing information that is useful for better handling of erro rs.
12 */
13 public class AuthException extends Exception {
14 private final boolean mIsTransientError;
15 private final Intent mRecoveryIntent;
16 private final Exception mInnerException;
17
18 /*
19 * A simple constructor that stores all the error handling information and m akes it available to
20 * the handler.
21 * @param isTransientError Whether the error is transient and we can retry.
22 * @param recoveryIntent An intent that can be used to recover from this err or.
23 * Thus, a user recoverable error is not transient, since it requires explic it user handling
24 * before retry.
25 */
26 public AuthException(boolean isTransientError, Intent recoveryIntent, Except ion exception) {
27 assert !isTransientError || recoveryIntent == null;
28 assert exception != null;
29 mIsTransientError = isTransientError;
30 mRecoveryIntent = recoveryIntent;
31 mInnerException = exception;
Bernhard Bauer 2015/11/20 18:55:42 You could pass this one to the super constructor i
knn 2015/11/23 11:35:32 Done.
32 }
33
34 /*
35 * @return Whether the error is transient and we can retry.
36 */
37 public boolean isTransientError() {
38 return mIsTransientError;
39 }
40
41 /*
42 * @return An intent that can be used to recover from this error if it is re coverabale by user
43 * intervention, else {@code null}.
44 */
45 public Intent getRecoveryIntent() {
46 return mRecoveryIntent;
47 }
48
49 /*
50 * @return The original exception that is encapsulated by this AuthException .
51 * Used for logging.
52 */
53 public Exception getInnerException() {
54 return mInnerException;
55 }
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698