A file-based task manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 92d69a30ff8e29caba866ea33aab70d2cee199cf 36 lines 1.1 kB view raw
1use std::{convert::Infallible, string::FromUtf8Error}; 2 3use thiserror::Error as ThisError; 4 5pub type Result<T> = std::result::Result<T, Error>; 6 7#[derive(ThisError, Debug)] 8pub enum Error { 9 #[error("The workspace is not initialized. Run `tsk init` to initialize it.")] 10 Uninitialized, 11 #[error("The tsk workspace is already initialized. No change.")] 12 AlreadyInitialized, 13 #[error("Unable to read file: {0}")] 14 Io(#[from] std::io::Error), 15 #[error("git error: {0}")] 16 Git(#[from] git2::Error), 17 #[error("Unable to parse id: {0}")] 18 ParseId(#[from] std::num::ParseIntError), 19 #[error("General parsing error: {0}")] 20 Parse(String), 21 #[error("Error parsing bytes as utf-8: {0}")] 22 FromUtf8(#[from] FromUtf8Error), 23 #[error("No tasks on stack")] 24 NoTasks, 25 #[allow(dead_code)] 26 #[error("An unexpected error occurred: {0}")] 27 Oops(Box<dyn std::error::Error>), 28 #[error("System time/clock error: {0}")] 29 SystemTime(#[from] std::time::SystemTimeError), 30} 31 32impl From<Infallible> for Error { 33 fn from(_: Infallible) -> Self { 34 unreachable!(); 35 } 36}