Hacker News new | ask | show | jobs
by BradleyChatha 323 days ago
If I understand the feature correctly, D has this via scope(failure) [1]

``` void func() { scope(failure) writeln("Something went wrong!"); } ```

[1] https://tour.dlang.org/tour/en/gems/scope-guards