package com.unity3d.services.core.extensions; import c9.a; import d9.j; import java.util.concurrent.CancellationException; import s8.n; import s8.o; /* loaded from: classes2.dex */ public final class CoroutineExtensionsKt { public static final Object runReturnSuspendCatching(a aVar) { Object b10; j.e(aVar, "block"); try { n.a aVar2 = n.f14096b; b10 = n.b(aVar.invoke()); } catch (CancellationException e10) { throw e10; } catch (Throwable th) { n.a aVar3 = n.f14096b; b10 = n.b(o.a(th)); } if (n.g(b10)) { return n.b(b10); } Throwable d10 = n.d(b10); return d10 != null ? n.b(o.a(d10)) : b10; } public static final Object runSuspendCatching(a aVar) { j.e(aVar, "block"); try { n.a aVar2 = n.f14096b; return n.b(aVar.invoke()); } catch (CancellationException e10) { throw e10; } catch (Throwable th) { n.a aVar3 = n.f14096b; return n.b(o.a(th)); } } }