diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-10-24 23:16:32 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-10-24 23:16:32 +0000 |
commit | e933f33b71de8d4b87603b1726f8b95ddea95bc6 (patch) | |
tree | 7ae4478a6d8b67c6b6d2da7ada44e5c82e9d7823 | |
parent | a9d899bd4da41c9ad1f3bb96c99133e4d3441889 (diff) | |
parent | 73e38f8b3d48fb0485d20a852d56f1b0ebd89d1e (diff) | |
download | gsma_services-e933f33b71de8d4b87603b1726f8b95ddea95bc6.tar.gz |
Snap for 10998794 from 73e38f8b3d48fb0485d20a852d56f1b0ebd89d1e to sdk-release
Change-Id: I916ed1c4fbc46b311abb16bc013525396f5bde9f
-rw-r--r-- | ts43authentication/src/com/android/libraries/ts43authentication/AuthenticationException.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ts43authentication/src/com/android/libraries/ts43authentication/AuthenticationException.java b/ts43authentication/src/com/android/libraries/ts43authentication/AuthenticationException.java index 707a7bf..efaddad 100644 --- a/ts43authentication/src/com/android/libraries/ts43authentication/AuthenticationException.java +++ b/ts43authentication/src/com/android/libraries/ts43authentication/AuthenticationException.java @@ -90,6 +90,11 @@ public class AuthenticationException extends Exception { public static final int ERROR_INVALID_HTTP_RESPONSE = 8; /** + * Authentication request failed because the request parameters were malformed. + */ + public static final int ERROR_INVALID_REQUEST = 9; + + /** * Authentication errors that can be returned by the TS.43 authentication library or * service entitlement library. */ @@ -104,6 +109,7 @@ public class AuthenticationException extends Exception { ERROR_MAXIMUM_EAP_AKA_ATTEMPTS, ERROR_HTTP_RESPONSE_FAILED, ERROR_INVALID_HTTP_RESPONSE, + ERROR_INVALID_REQUEST, }) public @interface AuthenticationError {} @@ -122,7 +128,15 @@ public class AuthenticationException extends Exception { private final int mHttpStatusCode; private final String mRetryAfter; - private AuthenticationException(@AuthenticationError int error, int httpStatusCode, + /** + * Create an AuthenticationException by setting all fields manually. + * + * @param error The authentication error. + * @param httpStatusCode The HTTP status code. + * @param retryAfter The {@code Retry-After} header from the HTTP response. + * @param message The detailed message with more information about the exception. + */ + public AuthenticationException(@AuthenticationError int error, int httpStatusCode, String retryAfter, String message) { super(message); mError = error; @@ -134,7 +148,7 @@ public class AuthenticationException extends Exception { * Create an AuthenticationException for the given {@link AuthenticationError}. * * @param error The authentication error. - * @param message The detail message with more information about the exception. + * @param message The detailed message with more information about the exception. */ public AuthenticationException(int error, String message) { this(error, HTTP_STATUS_CODE_UNSPECIFIED, RETRY_AFTER_UNSPECIFIED, message); |