| Modifier and Type | Method and Description |
|---|---|
static Scope |
Scope.beginScope()
正常应该优先使用
supplyWithNewScope(com.github.phantomthief.util.ThrowableSupplier<T, X>) 或者 runWithNewScope(com.github.phantomthief.util.ThrowableRunnable<X>)
手工使用beginScope和endScope的场景只有在:
上面两个方法当需要抛出多个正交异常时会造成不必要的try/catch代码
开始scope和结束scope不在一个代码块中
|
static Scope |
Scope.getCurrentScope() |
| Modifier and Type | Method and Description |
|---|---|
static <X extends Throwable> |
Scope.runWithExistScope(Scope scope,
com.github.phantomthief.util.ThrowableRunnable<X> runnable) |
static <T,X extends Throwable> |
Scope.supplyWithExistScope(Scope scope,
com.github.phantomthief.util.ThrowableSupplier<T,X> supplier) |
Copyright © 2019. All rights reserved.