1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub type Result<T = ()> = std::result::Result<T, Error>;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("Launch this program via todo.sh")]
    Env,
    #[error("Invalid period: {0}")]
    InvalidPeriod(String),
    #[error("Invalid priority: {0}")]
    InvalidPriority(char),
    #[error("Invalid recurrence: {0}")]
    InvalidRecurrence(String),
    #[error("Unable to save note: {0}")]
    Note(std::io::Error),
}