Try to find a way to flip the order of `mitigate` and `within`
propensive opened this issue · comments
Jon Pretty commented
Currently, the "mitigators" have to be defined before the body, which is not intuitive. It's not clear what would be the best way to do this, though.
Jon Pretty commented
One possible way may be to write it as a try
/catch
block within a mitigate
block, like this:
mitigate:
try
// some action
catch
case SomeError() => NewError()
but it's not clear whether the block would be accepted before the macro rewrites it.
Jon Pretty commented
mitigate
/within
is effectively deprecated in favor of given ... fixes ...
now.