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:
elipeter 2025-06-23 20:59:49 +02:00
parent 0a66a0ae2d
commit bd788a8373
9 changed files with 81 additions and 43 deletions

View file

@ -5,6 +5,7 @@ pub mod clean;
use crate::cli::Commands;
use std::path::Path;
use crate::errors::NyxResult;
use crate::patterns::Severity;
use crate::utils::config::Config;
@ -12,7 +13,7 @@ pub fn handle_command(
command: Commands,
database_dir: &Path,
config: &mut Config
) -> Result<(), Box<dyn std::error::Error>> {
) -> NyxResult<()> {
match command {
Commands::Scan { path, no_index, rebuild_index, format, high_only } => {
if high_only { config.scanner.min_severity = Severity::High };