Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
selinux: get closer to the GNU error msgs#7898
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
GNU testsuite comparison:
|
fn selinux_error_description(mut error: &dyn Error) -> String { | ||
let mut description = String::new(); | ||
while let Some(source) = error.source() { | ||
let error_text = source.to_string(); | ||
// Check if this is an OS error and trim it | ||
if let Some(idx) = error_text.find(" (os error ") { | ||
description.push_str(&error_text[..idx]); | ||
} else { | ||
description.push_str(&error_text); | ||
} | ||
error = source; | ||
} | ||
description | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is it intentional that there is no delimiter to separate the error texts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, I think so :)
7c865b2
intouutils:mainUh oh!
There was an error while loading.Please reload this page.
No description provided.