Feedback from the Gripes and Wishes Campaign
FeepingCreature
feepingcreature at gmail.com
Wed May 31 08:59:02 UTC 2023
On Tuesday, 30 May 2023 at 09:13:03 UTC, Commander Zot wrote:
>
> now take the `foo()?.bar()?.baz` example, but change it to log
> which part failed. it only looks simple for the most basic
> case, the second you need to do rollbacks or really anything
> else this approach gets so much more complicated.
```
foo()
.case(Error: return Error.failedAt(__RANGE__))
.bar()
.case(Error: return Error.failedAt(__RANGE__))
.baz;
```
And sure that looks verbose, but the moment I needed more than a
few of them I'd just add a macro for it.
More information about the Digitalmars-d
mailing list