Expand description
Unified error types for debtmap analysis operations (DEPRECATED).
DEPRECATED: This module’s AnalysisError type is deprecated in favor of
crate::debtmap_error::DebtmapError. The types here are maintained for backwards
compatibility during migration. New code should use DebtmapError.
This module provides error types that bridge between anyhow’s dynamic errors and stillwater’s structured effect system. The design allows gradual migration from anyhow to effect-based error handling while maintaining backwards compatibility.
§Migration
All types in this module implement Into<DebtmapError> for gradual migration:
ⓘ
use debtmap::errors::AnalysisError;
use debtmap::debtmap_error::DebtmapError;
let old_error = AnalysisError::io("Failed to read file");
let new_error: DebtmapError = old_error.into();§Design Philosophy
- Backwards Compatible: All existing code using
anyhow::Resultcontinues to work - Structured Errors: Categorized errors enable better error handling and reporting
- Accumulation Support: Error types support stillwater’s Validation pattern for collecting ALL errors instead of failing at the first one
§Example
use debtmap::errors::AnalysisError;
// Create typed errors
let io_err = AnalysisError::io("Failed to read file");
let parse_err = AnalysisError::parse("Invalid syntax at line 42");
// Convert to/from anyhow for backwards compatibility
let anyhow_err: anyhow::Error = io_err.clone().into();
let back_to_analysis: AnalysisError = anyhow_err.into();Re-exports§
pub use collection::AnalysisFailure;pub use collection::AnalysisResults;pub use collection::OperationType;pub use partition::ParPartitionResult;pub use partition::PartitionResult;pub use reporting::report_brief_summary;pub use reporting::report_completion_summary;pub use summary::ErrorSummary as AnalysisErrorSummary;
Modules§
- collection
- Error collection data structures for batch operations.
- partition
- Helper traits for partitioning Result iterators.
- reporting
- Completion reporting for batch analysis operations.
- summary
- Error summary generation for batch operations.
Structs§
- Error
Summary - Error summary for structured output.
Enums§
- Analysis
Error - Unified error type for debtmap analysis operations.
Functions§
- errors_
to_ anyhow - Convert a list of AnalysisErrors to an anyhow::Error with formatted message.
- format_
error_ list - Format a list of errors for display.
- format_
error_ report - Format error report for return as string (useful for testing).
- group_
errors_ by_ category - Group errors by category for structured reporting.
- print_
error_ report - Print an error report to stderr with formatting.
- print_
error_ report_ titled - Print an error report with a custom title.
- print_
grouped_ error_ report - Print a grouped error report organized by category.