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§
- Temps
Error - The main error type for the temps library.
Functions§
- rich_
errors_ to_ temps_ error - Convert a collection of chumsky parser errors into a
TempsErrorand an ariadne-rendered diagnostic string.
Type Aliases§
- Result
- Result type alias for temps operations.