Module errors

Module errors 

Source
Expand description

Core error types for ASS-RS utilities and cross-module error handling

Provides the main CoreError enum that wraps all error types from different modules in the crate. Designed for easy error propagation and conversion.

§Error Philosophy

  • Use thiserror for structured error handling (no anyhow bloat)
  • Provide detailed context for debugging and user feedback
  • Support error chains with source information
  • Include suggestions for common error scenarios
  • Maintain zero-cost error handling where possible

§Examples

use ass_core::utils::errors::{CoreError, Result, ErrorCategory};

// Create specific error types
let color_err = CoreError::invalid_color("invalid");
let time_err = CoreError::invalid_time("1:23", "missing seconds");

// Check error properties
assert_eq!(color_err.category(), ErrorCategory::Format);
assert!(color_err.suggestion().is_some());

Re-exports§

pub use encoding::utf8_error;
pub use encoding::validate_ass_text_content;
pub use encoding::validate_bom_handling;
pub use encoding::validate_utf8_detailed;
pub use resource::check_memory_limit;
pub use resource::feature_not_supported;
pub use resource::out_of_memory;
pub use resource::resource_limit_exceeded;

Modules§

encoding
Text encoding error utilities for ASS-RS
resource
Resource management error utilities for ASS-RS

Enums§

CoreError
Main error type for ASS-RS core operations
ErrorCategory
Error category for filtering and user interface organization

Functions§

invalid_color
Create color format error with detailed context
invalid_numeric
Create numeric parsing error with value and reason
invalid_time
Create time format error with time and reason
validate_color_format
Validate ASS color format

Type Aliases§

Result
Result type alias for convenience