ExceptionCatcher

interface ExceptionCatcher<T>

异常处理接口.

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun catchException(action: (Throwable) -> T)

捕获异常, 相当于 java 的 catch 代码块.

Link copied to clipboard
abstract fun finallyRun(action: () -> Unit)

无论有没有异常都会执行, 相当于 java 的 finally 代码块.

Link copied to clipboard
abstract fun tryRunning(action: () -> T)

执行可能抛出异常的代码.