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

chore: use native error messages from command output #181

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

Integral-Tech
Copy link
Contributor

@Integral-Tech Integral-Tech commented Jan 6, 2025

Description

  • When dmesg or modinfo returns error, we can just use their native error messages instead of custom ones. They are sometimes clearer, for example:

Native error message from dmesg

dmesg: read kernel buffer failed: Operation not permitted

Custom error message in kmon

failed to retrieve dmesg output

The first one indicates that the error is caused by "Operation not permitted", while the second one doesn't.

Motivation and Context

Make error messages clearer.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation and changelog accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Rustfmt and Rust-clippy passed.

@Integral-Tech Integral-Tech requested a review from orhun as a code owner January 6, 2025 13:39
src/kernel/lkm.rs Outdated Show resolved Hide resolved
src/kernel/log.rs Outdated Show resolved Hide resolved
@Integral-Tech
Copy link
Contributor Author

@orhun Suggestions applied :)

orhun
orhun previously approved these changes Jan 11, 2025
Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

thanks!

@orhun
Copy link
Owner

orhun commented Jan 11, 2025

ah, can you run cargo fmt and push the changes?

@Integral-Tech
Copy link
Contributor Author

@orhun Done :)

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

Thanks!

@orhun orhun merged commit b68e417 into orhun:master Jan 11, 2025
4 of 5 checks passed
@Integral-Tech Integral-Tech deleted the error-msg branch January 11, 2025 16:29
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.

2 participants