pub type TdoResult<T> = Result<T>;
pub mod todo_error {
error_chain! {
errors {
NotInList {
description("Todo is not in this list")
}
NoSuchList {
description("No such list")
}
CanNotRemoveDefault {
description("The default list can no be removed")
}
NameAlreadyExists {
description("There already exists a list with this name")
}
IDAlreadyExists {
description("There already exists a todo with this ID")
}
}
}
}
pub mod github_error {
error_chain! {
errors {
DoesNotExist {
description("Repository does not exist or you have no access to it")
}
BadCredentials {
description("Bad credentials")
}
NotAllowedToMove {
description("A github issue is not allowed to be moved out ouf the default list")
}
NoIssueAsigned {
description("There is no github issue asigned to this todo")
}
UnknownError {
description("An unknown error occured")
}
}
}
}
pub mod storage_error {
error_chain! {
errors {
FileCorrupted {
description("File is corrupted")
}
SaveFailure {
description("File could not be saved")
}
FileNotFound {
description("File was not found")
}
UnableToConvert {
description("File could not be converted automatically")
}
}
}
}
error_chain! {
links {
TodoError(todo_error::Error, todo_error::ErrorKind) #[doc = "An error within the tdo data structures occured."];
StorageError(storage_error::Error, storage_error::ErrorKind) #[doc = "A storage-related error occured while interacting with the file system."];
GithubError(github_error::Error, github_error::ErrorKind) #[doc = "A github communication-related error occured."];
}
}