OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.sync.signin; | 5 package org.chromium.components.sync.signin; |
6 | 6 |
7 /** | 7 /** |
8 * AuthException abstracts away authenticator specific exceptions behind a singl
e interface. | 8 * AuthException abstracts away authenticator specific exceptions behind a singl
e interface. |
9 * It is used for passing information that is useful for better handling of erro
rs. | 9 * It is used for passing information that is useful for better handling of erro
rs. |
10 */ | 10 */ |
11 public class AuthException extends Exception { | 11 public class AuthException extends Exception { |
12 private final boolean mIsTransientError; | 12 private final boolean mIsTransientError; |
13 | 13 |
14 /** | 14 /** |
15 * A simple constructor that stores all the error handling information and m
akes it available to | 15 * A simple constructor that stores all the error handling information and m
akes it available to |
16 * the handler. | 16 * the handler. |
17 * @param isTransientError Whether the error is transient and we can retry. | 17 * @param isTransientError Whether the error is transient and we can retry. |
18 * Thus, a user recoverable error is not transient, since it requires explic
it user handling | 18 * Thus, a user recoverable error is not transient, since it requires explic
it user handling |
19 * before retry. | 19 * before retry. |
20 */ | 20 */ |
21 public AuthException(boolean isTransientError, Exception exception) { | 21 public AuthException(boolean isTransientError, Exception exception) { |
22 super(exception); | 22 super(exception); |
23 assert !isTransientError; | 23 assert !isTransientError; |
24 mIsTransientError = isTransientError; | 24 mIsTransientError = isTransientError; |
25 } | 25 } |
26 | 26 |
27 /** | 27 /** |
28 * @return Whether the error is transient and we can retry. | 28 * @return Whether the error is transient and we can retry. |
29 */ | 29 */ |
30 public boolean isTransientError() { | 30 public boolean isTransientError() { |
31 return mIsTransientError; | 31 return mIsTransientError; |
32 } | 32 } |
33 } | 33 } |
OLD | NEW |