|
|
|
|
|
by twiss
37 days ago
|
|
> Returns across multiple calls. `return err from load` returns from a function any number of frames up, statically checked, with no unwinder, no `Result` type and no `?` on every call. Does this mean you have to know the name of the function calling you that's supposed to handle the error? What if you're a library and don't know that? |
|
One idea that came up was this: you could define a particuda function name as the "landing pad" for handling particular error kinds. Then you "wrap" calls to the library in a function with this name. Here's a part from a larger worked example:
https://gist.github.com/bkietz/9bf510299ab62bb4c7f7d2db6eff0...Mind you, this was just discussion, no experience with how well this would work in practice.