-
Notifications
You must be signed in to change notification settings - Fork 91
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
CargoMetadata variant on enum Error is not enough structured #168
Comments
Hmm... the stderr is unstructured, so I'm not sure how we could emit something better. Do you have any suggestions on how to resolve this issue? |
I don't know much about cargo metadata maybe by doing the parsing trying a "best guess" of the underline error and fallback to a raw error if the parsing didn't guess the error type, doing the parsing here have the big advantage to not implement the parsing in every crate that use cargo_metadata: enum Error {
CargoMetadata(CargoMetadataError),
// ..
}
enum CargoMetadataError {
ConfigNotFound {
file: BufPath,
dir: BufPath,
},
OtherError,
Unknown{
stderr: String,
},
} This is clearly not perfect but I don't have any better since this is just a wrapper other The first thing to have would be to have a list of every current error |
Hmm... I dimly remember that there is a way to make cargo generally emit json errors, maybe that works for cargo metadata, too? |
you know better than me but I search a little when you ask me a solution and didn't find anything. But I think we could make a request for it #63. And this would help much more than just this crate so that would be very nice. Having a error output format, and have error structure public. To everyone that wrap cargo command. |
CargoMetadata
is not usable to give a precise error to the user, notably on program like bacon that end up doing a random parsing on stderr.The text was updated successfully, but these errors were encountered: