December 06, 2019 errno the ugly duckling | ||||
---|---|---|---|---|
| ||||
Exceptions + Best solution for rare errors Expected!Andrei + Best general error-handling mechanism No matter which error camp you belong to, errno is universally scorned. Before TLS support became ubiquitous, global errno was useless, with TLS it's no longer a real problem, now can we improve errno even futher? Exception last_error; // TLS & Rich error info LastExceptionWhichOccuredOnThisThread + Zero-cost in hot-path + Decent performance in error-path (Better than Exceptions) - No support for fibers - Not pure I'm not claming this is the best general error-handling mechanism, it's not suitable for a standard library etc. I'm just wondering, does this fill a niche for certain libraries. |
Copyright © 1999-2021 by the D Language Foundation