From 2e6f087a3a7473fe2a91d8448478a45f4a4322cf Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Thu, 10 Oct 2019 17:22:53 -0400 Subject: [PATCH] Minor change to fern init results and added to error file --- .travis.yml | 6 ++++++ Cargo.toml | 1 + src/main.rs | 2 +- src/utils/error.rs | 11 +++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ec07db4b..cd33a1f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,9 @@ matrix: rust: nightly before_script: rustup target add $TARGET script: cargo build --release --target $TARGET + on: + branch: master + tags: true addons: apt: packages: @@ -49,6 +52,9 @@ matrix: rust: nightly before_script: rustup target add $TARGET script: cargo build --release --target $TARGET + on: + branch: master + tags: true <<: *DEPLOY_TO_GITHUB notifications: diff --git a/Cargo.toml b/Cargo.toml index 73d1ef7b..bcd13962 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ heim = "0.0.7" heim-common = "0.0.7" log = "0.4" rayon = "1.2" +regex = "1.3.1" sysinfo = "0.9.4" tokio = "0.2.0-alpha.4" winapi = "0.3.8" diff --git a/src/main.rs b/src/main.rs index bb57c1d2..d9825b10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ enum Event { } fn main() -> error::Result<()> { - let _log = utils::logging::init_logger(); // TODO: Note this could fail and we wouldn't know... consider whether it is worth dealing with + utils::logging::init_logger()?; // Parse command line options let matches = clap_app!(app => diff --git a/src/utils/error.rs b/src/utils/error.rs index ed829c3e..b38cf962 100644 --- a/src/utils/error.rs +++ b/src/utils/error.rs @@ -32,6 +32,11 @@ pub enum RustopError { /// The data provided is the error found. #[fail(display = "ERROR: Invalid generic error: {}", message)] GenericError { message : String }, + /// An error to represent errors with fern + /// + /// The data provided is the error found. + #[fail(display = "ERROR: Invalid fern error: {}", message)] + FernError { message : String }, } impl From for RustopError { @@ -63,3 +68,9 @@ impl From for RustopError { RustopError::GenericError { message : err.to_string() } } } + +impl From for RustopError { + fn from(err : fern::InitError) -> Self { + RustopError::FernError { message : err.to_string() } + } +}