Carter Hudson
09/12/2024, 4:50 PMensure
blocks in the raise dsl?Youssef Shoaib [MOD]
09/12/2024, 4:51 PMrecover
exists. But likely you want to use any of the myriad of other builders to recover.Carter Hudson
09/12/2024, 4:52 PMensure(...) {
recover {
// ...
}
}
Carter Hudson
09/12/2024, 4:52 PMYoussef Shoaib [MOD]
09/12/2024, 4:54 PMensure
, so you could do something like:
someFunction {
ensure(...) { return@someFunction ... }
}
But at this point, why not just use if(!condition) ...
Carter Hudson
09/12/2024, 4:57 PMYoussef Shoaib [MOD]
09/12/2024, 5:00 PM?:
lol
I think you could be experiencing a golden hammer problem?Carter Hudson
09/12/2024, 5:00 PMCarter Hudson
09/12/2024, 5:01 PMYoussef Shoaib [MOD]
09/12/2024, 5:01 PMif (!condition) raise(block()
and hence if you want "variations" on it, you likely want an if
statementCarter Hudson
09/12/2024, 5:02 PM