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

sync: Remove crash! #5847

Closed
wants to merge 8 commits into from
Closed

Conversation

daria-tanasie
Copy link

The issue: Remove all uses of crash! #5487
Replaced all uses of crash! from the file "src/uu/sync/src/sync.rs" with the show! macro

@cakebaker cakebaker changed the title Remove crash! sync: Remove crash! Jan 15, 2024
@alexandruradovici
Copy link

Please run cargo fmt to format your code.

@cakebaker
Copy link
Contributor

I don't know if you have seen it: the CI shows some errors on Windows:

error[E0433]: failed to resolve: use of undeclared type `USimpleError`
  --> src\uu\sync\src/sync.rs:91:31
   |
91 |                         show!(USimpleError::new(
   |                               ^^^^^^^^^^^^ use of undeclared type `USimpleError`

I think you forgot a use statement.

Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

We need to be a bit careful here. show! is not equivalent to crash!, because crash! exits the program and show! doesn't. To keep the same behaviour, we therefore need to make the fallible functions return a UResult and bubble the error up to the main function. For example, we now might return an INVALID_HANDLE on like 115 to some code that might expect a valid handle.

@Kev1n8
Copy link
Contributor

Kev1n8 commented Jul 6, 2024

@daria-tanasie I wonder if you are still working on this. If not, I'd like to make some effort on it.

@Kev1n8
Copy link
Contributor

Kev1n8 commented Jul 7, 2024

@tertsdiepraam I would like to open another PR regarding this since this one has been hanging for a while, is that ok?

@sylvestre
Copy link
Contributor

sylvestre commented Jul 7, 2024 via email

@sylvestre
Copy link
Contributor

fixed here: #6547

@sylvestre sylvestre closed this Jul 9, 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.

6 participants