- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
31 lines
1.3 KiB
Java
31 lines
1.3 KiB
Java
package kotlinx.coroutines;
|
|
|
|
import kotlin.ExceptionsKt__ExceptionsKt;
|
|
import kotlin.coroutines.CoroutineContext;
|
|
import kotlinx.coroutines.internal.CoroutineExceptionHandlerImpl_commonKt;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class CoroutineExceptionHandlerKt {
|
|
public static final void handleCoroutineException(CoroutineContext coroutineContext, Throwable th) {
|
|
try {
|
|
CoroutineExceptionHandler coroutineExceptionHandler = (CoroutineExceptionHandler) coroutineContext.get(CoroutineExceptionHandler.Key);
|
|
if (coroutineExceptionHandler != null) {
|
|
coroutineExceptionHandler.handleException(coroutineContext, th);
|
|
} else {
|
|
CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(coroutineContext, th);
|
|
}
|
|
} catch (Throwable th2) {
|
|
CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(coroutineContext, handlerException(th, th2));
|
|
}
|
|
}
|
|
|
|
public static final Throwable handlerException(Throwable th, Throwable th2) {
|
|
if (th == th2) {
|
|
return th;
|
|
}
|
|
RuntimeException runtimeException = new RuntimeException("Exception while trying to handle coroutine exception", th2);
|
|
ExceptionsKt__ExceptionsKt.addSuppressed(runtimeException, th);
|
|
return runtimeException;
|
|
}
|
|
}
|