package com.google.android.gms.tasks;

import androidx.annotation.Nullable;
import w8.h;
import w8.t;

/* JADX INFO: loaded from: classes2.dex */
public final class DuplicateTaskCompletionException extends IllegalStateException {
    private DuplicateTaskCompletionException(String str, @Nullable Throwable th) {
        super(str, th);
    }

    public static IllegalStateException a(h hVar) {
        if (!hVar.i()) {
            return new IllegalStateException("DuplicateTaskCompletionException can only be created from completed Task.");
        }
        Exception exception = hVar.getException();
        return new DuplicateTaskCompletionException("Complete with: ".concat(exception != null ? "failure" : hVar.j() ? "result ".concat(String.valueOf(hVar.g())) : ((t) hVar).f34253d ? "cancellation" : "unknown issue"), exception);
    }
}
