aoc-toolkit 0.1.0-alpha.2

A toolkit for solving Advent of Code problems
Documentation
use std::path::PathBuf;

use crate::application::auth::ClientError;
use crate::application::init::InitError;
use crate::application::new::NewError;
use crate::application::run::RunError;
use crate::project::ProjectError;

#[derive(Debug, thiserror::Error)]
pub enum CliError {
    #[error("Cannot determine current directory: {0}")]
    CurrentDirectory(#[source] std::io::Error),

    #[error("Cannot resolve destination {path:?}: {source}")]
    ResolveDestination {
        path: PathBuf,
        #[source]
        source: std::io::Error,
    },

    #[error("Cannot infer package name from {0:?}; use --name")]
    MissingPackageName(PathBuf),

    #[error(transparent)]
    Project(#[from] ProjectError),

    #[error(transparent)]
    Run(#[from] RunError),

    #[error(transparent)]
    Init(#[from] InitError),

    #[error(transparent)]
    New(#[from] NewError),

    #[error("Cannot read session from terminal: {0}")]
    ReadSession(#[source] std::io::Error),

    #[error(transparent)]
    Auth(#[from] ClientError),

    #[error("Browser registration failed: {0}")]
    BrowserRegistration(#[source] std::io::Error),
}