package fast.rocket.error; import fast.rocket.response.NetworkResponse; import android.content.Intent; /** * Error indicating that there was an authentication failure when performing a Request. */ @SuppressWarnings("serial") public class AuthFailureError extends RocketError { /** An intent that can be used to resolve this exception. (Brings up the password dialog.) */ private Intent mResolutionIntent; public AuthFailureError() { } public AuthFailureError(Intent intent) { mResolutionIntent = intent; } public AuthFailureError(NetworkResponse response) { super(response); } public AuthFailureError(String message) { super(message); } public AuthFailureError(String message, Exception reason) { super(message, reason); } public Intent getResolutionIntent() { return mResolutionIntent; } @Override public String getMessage() { if (mResolutionIntent != null) { return "User needs to (re)enter credentials."; } return super.getMessage(); } }