Minor change to fern init results and added to error file

This commit is contained in:
ClementTsang 2019-10-10 17:22:53 -04:00
parent cc8467ad45
commit 2e6f087a3a
4 changed files with 19 additions and 1 deletions

View File

@ -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:

View File

@ -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"

View File

@ -34,7 +34,7 @@ enum Event<I, J> {
}
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 =>

View File

@ -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<std::io::Error> for RustopError {
@ -63,3 +68,9 @@ impl From<std::string::String> for RustopError {
RustopError::GenericError { message : err.to_string() }
}
}
impl From<fern::InitError> for RustopError {
fn from(err : fern::InitError) -> Self {
RustopError::FernError { message : err.to_string() }
}
}