package defpackage;

import androidx.work.f;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;

/* JADX INFO: loaded from: classes.dex */
class iva implements Runnable {
    public final /* synthetic */ String a;
    public final /* synthetic */ jva b;

    public iva(jva jvaVar, String str) {
        this.b = jvaVar;
        this.a = str;
    }

    @Override // java.lang.Runnable
    public final void run() {
        String str = this.a;
        jva jvaVar = this.b;
        lta ltaVar = jvaVar.c;
        try {
            try {
                f.a aVar = (f.a) jvaVar.r.get();
                if (aVar == null) {
                    eh5.c().a(jva.t, ltaVar.c + " returned a null result. Treating it as a failure.");
                } else {
                    eh5 eh5VarC = eh5.c();
                    String str2 = jva.t;
                    String str3 = ltaVar.c;
                    aVar.toString();
                    eh5VarC.getClass();
                    jvaVar.f = aVar;
                }
                jvaVar.b();
            } catch (InterruptedException e) {
                e = e;
                eh5.c().b(jva.t, str + " failed because it threw an exception/error", e);
                jvaVar.b();
            } catch (CancellationException unused) {
                eh5 eh5VarC2 = eh5.c();
                String str4 = jva.t;
                eh5VarC2.getClass();
                jvaVar.b();
            } catch (ExecutionException e2) {
                e = e2;
                eh5.c().b(jva.t, str + " failed because it threw an exception/error", e);
                jvaVar.b();
            }
        } catch (Throwable th) {
            jvaVar.b();
            throw th;
        }
    }
}
