4 ms·
> I do not want to go to the hassle of defining some new error types everywhere, I just want to use equivalents to runtime_error or logic_error. You can use an
by Expurple 1y ago
> I do not want to go to the hassle of defining some new error types everywhere, I just want to use equivalents to runtime_error or logic_error.
You can use anyhow::Error everywhere. If you need to "catch" a specific wrapped error, you can manually document it on the "throwing" method and downcast where you "catch". It's very similar to exceptions (checked-but-unspecific `throws Exception` in Java), but better, because Result and ? are explicit.