plut-core 2.10.0

Project model, run context and diagnostics for Plut
Documentation
use std::path::PathBuf;

/// Everything that can go wrong before a rule runs.
#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("no Rojo project or sourcemap found under {0}")]
    NoProject(PathBuf),

    #[error("no such file or directory: {0}")]
    NotFound(PathBuf),

    #[error("failed to read {path}: {source}")]
    Read {
        path: PathBuf,
        source: std::io::Error,
    },

    #[error("failed to write {path}: {source}")]
    Write {
        path: PathBuf,
        source: std::io::Error,
    },

    #[error("failed to parse {path}: {source}")]
    ParseJson {
        path: PathBuf,
        source: serde_json::Error,
    },

    #[error("failed to parse {path}: {source}")]
    ParseToml {
        path: PathBuf,
        source: toml::de::Error,
    },

    #[error("failed to walk {path}: {source}")]
    Walk {
        path: PathBuf,
        source: ignore::Error,
    },

    #[error("invalid exclude glob {pattern}: {source}")]
    Glob {
        pattern: String,
        source: globset::Error,
    },

    #[error("could not run rojo: {0}")]
    Rojo(std::io::Error),

    #[error("rojo sourcemap exited with {code}: {stderr}")]
    RojoFailed { code: i32, stderr: String },
}