Module error

Source
Expand description

Error types for the temps library.

This module defines the error types used throughout the temps ecosystem. All parsing and date calculation operations return Result<T, TempsError>.

§Error Categories

  • Parse Errors: When input cannot be parsed as a valid time expression
  • Date Calculation Errors: When date arithmetic results in invalid dates
  • Invalid Component Errors: When date/time components are out of range
  • Backend Errors: When the underlying datetime library reports an error

§Examples

use temps_core::{parse, Language, TempsError};

// Parse error example
let result = parse("invalid input", Language::English);
match result {
    Err(TempsError::ParseError { message, input, position }) => {
        println!("Parse failed: {}", message);
    }
    _ => {}
}

Enums§

TempsError
The main error type for the temps library.

Traits§

ParseErrorExt
Extension trait for converting parser errors to TempsError.

Type Aliases§

Result
Result type alias for temps operations.