mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-03 20:41:00 +02:00
Refactor error handling with NyxResult and enhance debugging
- Replaced `Result` with `NyxResult` across the codebase for consistent error management. - Enhanced `NyxError` with new variants and utility conversions for better flexibility. - Added detailed `tracing::debug` logs in `file.rs` and `walk.rs` for improved traceability. - Simplified conditionals and improved path handling in `file.rs`. - Refined severity filtering logic in `scan.rs`.
This commit is contained in:
parent
0a66a0ae2d
commit
bd788a8373
9 changed files with 81 additions and 43 deletions
|
|
@ -73,11 +73,12 @@ pub fn spawn_senders(root: &Path, cfg: &Config) -> Receiver<Batch> {
|
|||
.build_parallel()
|
||||
.run(move || {
|
||||
let mut b = Batcher {
|
||||
tx: tx.clone(),
|
||||
tx: tx.clone(),
|
||||
batch: Vec::with_capacity(DEFAULT_BATCH),
|
||||
};
|
||||
|
||||
Box::new(move |entry| {
|
||||
tracing::debug!("walking {:?}", entry);
|
||||
let entry = match entry {
|
||||
Ok(e) if e.file_type().map(|ft| ft.is_file()).unwrap_or(false) => e,
|
||||
_ => return WalkState::Continue,
|
||||
|
|
@ -93,7 +94,8 @@ pub fn spawn_senders(root: &Path, cfg: &Config) -> Receiver<Batch> {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tracing::debug!("sending {:?}", entry);
|
||||
b.push(entry.into_path());
|
||||
WalkState::Continue
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue