8000 Handle better some errors by sylvestre · Pull Request #5791 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle better some errors #5791

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

Merged
merged 4 commits into from
Jan 15, 2024
Merged

Handle better some errors #5791

merged 4 commits into from
Jan 15, 2024

Conversation

sylvestre
Copy link
Contributor

for these two fixes, it was breaking some Rust errors
tested in tests/misc/read-errors.sh

@cakebaker
Copy link
Contributor

Fails on Windows:

thread 'test_basenc::test_invalid_input' panicked at tests\by-util\test_basenc.rs:27:10:
assertion failed: `(left == right)`

Diff < left / right > :
<basenc: .: Permission denied
>basenc: error: invalid input

Comment on lines +83 to +87
Err(e) => {
set_exit_code(1);
show_error!("error reading input: {}", e);
return Ok(());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels very similar to what UIoError does, but this is also quite clear, so it's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how to do that with the Ok? do you we have other examples ?


#[test]
fn fails_on_directory() {
new_ucmd!().arg("<").arg(".").fails();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails as it should, but not for the reason you're expecting. The < will not pipe here. It will be an argument to factor, so factor '<' '.'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ah, fun :)

@uutils uutils deleted a comment from github-actions bot Jan 8, 2024
@cakebaker cakebaker merged commit 112eb21 into uutils:main Jan 15, 2024
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 this pull request may close these issues.

3 participants
0