Created
June 3, 2022 11:05
-
-
Save myungpyo/d16d49c60cee475bd3a4521992816d69 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Standalone Coroutine | |
override fun handleJobException(exception: Throwable): Boolean { | |
handleCoroutineException(context, exception) | |
return true | |
} | |
public fun handleCoroutineException(context: CoroutineContext, exception: Throwable) { | |
try { | |
context[CoroutineExceptionHandler]?.let { | |
it.handleException(context, exception) | |
return | |
} | |
} catch (t: Throwable) { | |
handleCoroutineExceptionImpl(context, handlerException(exception, t)) | |
return | |
} | |
handleCoroutineExceptionImpl(context, exception) | |
} | |
// Deferred Coroutine | |
protected open fun handleJobException(exception: Throwable): Boolean = false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment