OLD | NEW |
| (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 /** | |
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. | |
10 */ | |
11 public class AuthException extends Exception { | |
12 private final boolean mIsTransientError; | |
13 | |
14 /** | |
15 * A simple constructor that stores all the error handling information and m
akes it available to | |
16 * the handler. | |
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 | |
19 * before retry. | |
20 */ | |
21 public AuthException(boolean isTransientError, Exception exception) { | |
22 super(exception); | |
23 assert !isTransientError; | |
24 mIsTransientError = isTransientError; | |
25 } | |
26 | |
27 /** | |
28 * @return Whether the error is transient and we can retry. | |
29 */ | |
30 public boolean isTransientError() { | |
31 return mIsTransientError; | |
32 } | |
33 } | |
OLD | NEW |