-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose testerror (and minor docs improvements) #14
Conversation
7661a7d
to
5a2913e
Compare
Rebased to add my S-o-b. Sorry, I hadn't noticed that this project used this convention (which I approve of!) |
There's still one issue with the clippy lint hopefully resolved with #15.
Hah, that's cool too! Initially I went the route of Errors too but it didn't work for anyhow and I didn't like the anyhow dependency. I see you've taken another route and arrived with a different solution. I'm wondering if it makes sense to somehow marry these two 🤔 (for anyhow another person suggested just using native anyhow features: #6 (comment)). |
Signed-off-by: Ian Jackson <[email protected]>
Signed-off-by: Ian Jackson <[email protected]>
Signed-off-by: Ian Jackson <[email protected]>
5a2913e
to
7ef38fd
Compare
Rebased as suggested.
Possibly. I guess one could make the I wrestled with |
Oh and:
Having it panic on conversion can mean that when you look at it in a debugger, many of the local variables you want to inspect are still live - since the panic is called from the function that generated the error, rather than from main or somewhere after the stack has been unwound. I think it may also work better with So I think the uninhabited type is a good approach, which is useful in quite a few contexts, even thouth there's that backtrace feature in anyhow. (In Tor we also have a stacktrace-containing |
Thanks for providing me with more context. I'll be slowly digesting it. As for testresult I plan to do a little bit of cleanups w.r.t. CI and docs and will release 0.4.1 shortly. Thank you for your work and time. It's greatly appreciated! 🙇♂️ |
You're welcome, and thanks. It's been a pleasure :-). |
Closes #13
Apropos the discussion there, I think it's fine to expose that this is
enum {}
. We probably don't want to change that - in particular, we aren't likely to want to make this an alias for something else, nor are we likely to need to make it an opaquestruct
.(Incidentally, I have a similar type in one of my own projects: https://salsa.debian.org/iwj/otter/-/blob/main/apitest/apitest.rs?ref_type=heads#L109. Mine is different to
TestError
because it displays error sources too, which is a different answer to the problem thatDisplay
is kind of broken for implementors ofstd::error::Error
.)