Skip to content
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

Improve error output. "Corrupt XZ stream error" returned for files with multi-streams #70

Open
Paul-E opened this issue Dec 29, 2020 · 1 comment · May be fixed by #74
Open

Improve error output. "Corrupt XZ stream error" returned for files with multi-streams #70

Paul-E opened this issue Dec 29, 2020 · 1 comment · May be fixed by #74

Comments

@Paul-E
Copy link

Paul-E commented Dec 29, 2020

When reading a file with multiple streams, it is necessary to use new_multi_decoder (introduced in #31). Using XzDecoder::new on a multi-stream will result in an error like below:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "corrupt xz stream" }', src/main.rs:13:14

This message could be improved. Perhaps it should read "Corrupt xz stream, or multi-stream. Use new_multi_decoder if this is a multi-stream".

Additionally, is there a way to determine if something is a multi-stream before creating a decoder?

@alexcrichton
Copy link
Owner

Seems reasonable to me to improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants