From 808813f635f73860ceabd79aca3f3e395b5a9c06 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 20:58:17 +0000 Subject: [PATCH] Move FirebaseInstallationsException.kt to src/main/kotlin Co-authored-by: ryanwilson <1097316+ryanwilson@users.noreply.github.com> --- .../FirebaseInstallationsException.kt} | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) rename firebase-installations/src/main/{java/com/google/firebase/installations/FirebaseInstallationsException.java => kotlin/com/google/firebase/installations/FirebaseInstallationsException.kt} (60%) diff --git a/firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallationsException.java b/firebase-installations/src/main/kotlin/com/google/firebase/installations/FirebaseInstallationsException.kt similarity index 60% rename from firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallationsException.java rename to firebase-installations/src/main/kotlin/com/google/firebase/installations/FirebaseInstallationsException.kt index a885a4d6c64..97ddf0d5edd 100644 --- a/firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallationsException.java +++ b/firebase-installations/src/main/kotlin/com/google/firebase/installations/FirebaseInstallationsException.kt @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -package com.google.firebase.installations; +package com.google.firebase.installations -import androidx.annotation.NonNull; -import com.google.firebase.FirebaseException; +import com.google.firebase.FirebaseException /** - * The class for all Exceptions thrown by {@link FirebaseInstallations}. + * The class for all Exceptions thrown by [FirebaseInstallations]. * * @hide */ -public class FirebaseInstallationsException extends FirebaseException { - public enum Status { +open class FirebaseInstallationsException : FirebaseException { + + enum class Status { /** * Indicates that the caller is misconfigured, usually with a bad or misconfigured API Key or * Project. @@ -35,27 +35,11 @@ public enum Status { * may be corrected by retrying. We recommend exponential backoff when retrying requests. */ UNAVAILABLE, + /** * Firebase servers have received too many requests in a short period of time from the client. */ - TOO_MANY_REQUESTS, - } - - @NonNull private final Status status; - - public FirebaseInstallationsException(@NonNull Status status) { - this.status = status; - } - - public FirebaseInstallationsException(@NonNull String message, @NonNull Status status) { - super(message); - this.status = status; - } - - public FirebaseInstallationsException( - @NonNull String message, @NonNull Status status, @NonNull Throwable cause) { - super(message, cause); - this.status = status; + TOO_MANY_REQUESTS } /** @@ -63,8 +47,18 @@ public FirebaseInstallationsException( * * @return the status for the FirebaseInstallationsException */ - @NonNull - public Status getStatus() { - return status; + var status: Status = Status.BAD_CONFIG + private set + + constructor(status: Status) : super() { + this.status = status + } + + constructor(message: String, status: Status) : super(message) { + this.status = status + } + + constructor(message: String, status: Status, cause: Throwable) : super(message, cause) { + this.status = status } }