From 3783b6ace86957c95e5137c7645af319dd2462e9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 28 Mar 2021 17:13:27 +0300 Subject: feat: set version in Cargo.toml for Rust projects --- src/errors.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 607eecb..282b5c5 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,5 +1,31 @@ +use std::path::PathBuf; + #[derive(Debug, thiserror::Error)] pub enum BumperError { + #[error("Can't figure out what kind of project: {0}")] + UnknownProjectKind(PathBuf), + + #[error("Couldn't read file {0}: {1}")] + Read(PathBuf, #[source] std::io::Error), + + #[error("Couldn't write file {0}: {1}")] + Write(PathBuf, #[source] std::io::Error), + + #[error("Couldn't find Cargo.toml in {0}: {1}")] + CargoTomlNotFound(PathBuf, #[source] cargo_edit::Error), + + #[error("Couldn't parse Cargo.toml from {0}: {1}")] + FromToml(PathBuf, #[source] cargo_edit::Error), + + #[error("Couldn't create Cargo.toml manifest to {0}: {1}")] + WriteToml(PathBuf, #[source] cargo_edit::Error), + + #[error("Cargo.toml doesn't have a 'package' table")] + NoPackage(#[source] cargo_edit::Error), + + #[error("'project' in Cargo.toml is not a table")] + ProjectNotTable, + #[error("Failed to run git: {0}")] GitInvoke(#[source] std::io::Error), -- cgit v1.2.1