In the JS/typescript world, neverthrow [1] may be the closest library for this. If anyone has good experience with something else, please reply. Not sure if neverthrow is the right choice after replacing all Errors in a 16k LOC engine library with it. It did added more "noise" to the code. Would a custom bespoke code/library add less noise? I'm not sure.
Very timely, was just trying to understand how to improve error handling with typescript recently and came across neverthrow (https://github.com/supermacro/neverthrow) which looks promising…
On my team we use Rust-style Result/Option types for any unrecoverable exceptions.