1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
// File: src\error.rs // Author: Hadi Cahyadi <cumulus13@gmail.com> // Date: 2026-05-09 // Description: // License: MIT use std::io; use thiserror::Error; /// Custom error types for dtime #[derive(Error, Debug)] pub enum DtimeError { /// IO errors #[error("IO error: {0}")] Io(#[from] io::Error), /// Invalid timezone #[error("Invalid timezone: {0}")] InvalidTimezone(String), /// Invalid format #[error("Invalid output format: {0}")] InvalidFormat(String), /// General error #[error("Error: {0}")] General(String), } /// Result type alias for dtime pub type Result<T> = std::result::Result<T, DtimeError>;