library
/
com.secoo.coobox.library.util.crash
Package com.
secoo.
coobox.
library.
util.
crash
Types
Functions
Types
Result
Link copied to clipboard
data class
Result
<out
R
>(value:
R
?, exception:
Throwable
?)
Content copied to clipboard
一个包装了结果和异常的数据类
Functions
getSafely
Link copied to clipboard
inline fun <
R
>
getSafely
(getAction: () ->
R
?):
Result
<
R
>
Content copied to clipboard
安全地执行获取操作
getValueSafely
Link copied to clipboard
inline fun <
R
>
getValueSafely
(getValueAction: () ->
R
?):
R
?
Content copied to clipboard
安全地执行取值操作
runSafely
Link copied to clipboard
inline fun
runSafely
(block: () ->
Unit
):
Boolean
Content copied to clipboard
安全执行block,捕获其中可能发生的异常 如果没有异常,返回true,否则返回false