-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Using miette in a middleware trait definition #156
Comments
Thanks for the comments, and I'm glad you're enjoying the crate! Stuff like this is super welcome :) |
I agree that it is not straightforward, but since |
I've been thinking about your response @zkat, could you explain what you mean with a 'wrapper diagnostic enum'? I currently can't picture what you mean sadly. I've also tried to use a |
I don't know what the ideal solution here is. I admit it's hard and I don't have a good answer, but I think the above is a good direction to try and head in and see how it feels. |
I'd say that with the merging of #165 most of the pain points are gone and should work fine until the Provider API is there in some form. Thanks! |
I currently have a trait akin to:
Which works fine until I try to use that
Error
in my own error reporting. I hit a couple of snags which I am not sure how to resolve:Error
does not implementDiagnostic
orstd::error::Error
, meaning that I can't use it in#[related]
nor inthiserror::Error
#[source]
annotations. I could implementDiagnostic
myself, but this is particularly 'annoying' in my case since its a enum with a dozen of error kinds.#[related]
wants to see something that isIntoIterator
but I usually just have a single error on which I want to add context. My current 'workaround' is to use a single element array, but it does look weird haha.Now, these are just some painpoints I identified in this situation. I don't know if/how they come from my usage of the crate, but I still wanted to report my experience and potentially discuss solutions/changes that would make it easier to use here.
Thank you for making the crate!
The text was updated successfully, but these errors were encountered: