From a9e51af7e0b7fc5240de4b838dcac103fd021448 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 4 Aug 2018 16:11:49 +1000 Subject: [PATCH] Add logging for install/uninstall errors --- src/rest.rs | 10 ++++++++-- src/tasks/resolver.rs | 2 +- static/index.html | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/rest.rs b/src/rest.rs index 6cf581c..13a4b03 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -164,7 +164,10 @@ impl Service for WebService { let mut framework = framework.write().unwrap(); match framework.uninstall(&sender) { - Err(v) => sender.send(InstallMessage::Error(v)).unwrap(), + Err(v) => { + eprintln!("Uninstall error occurred: {:?}", v); + sender.send(InstallMessage::Error(v)).unwrap(); + }, _ => {} } sender.send(InstallMessage::EOF).unwrap(); @@ -234,7 +237,10 @@ impl Service for WebService { } match framework.install(to_install, &sender, new_install) { - Err(v) => sender.send(InstallMessage::Error(v)).unwrap(), + Err(v) => { + eprintln!("Install error occurred: {:?}", v); + sender.send(InstallMessage::Error(v)).unwrap(); + }, _ => {} } sender.send(InstallMessage::EOF).unwrap(); diff --git a/src/tasks/resolver.rs b/src/tasks/resolver.rs index 94de320..e22087f 100644 --- a/src/tasks/resolver.rs +++ b/src/tasks/resolver.rs @@ -54,7 +54,7 @@ impl Task for ResolvePackageTask { let filtered_regex = package.source.match_regex.replace("#PLATFORM#", OS); let regex = match Regex::new(&filtered_regex) { Ok(v) => v, - Err(v) => return Err(format!("An error occured while compiling regex: {:?}", v)), + Err(v) => return Err(format!("An error occurred while compiling regex: {:?}", v)), }; // Find the latest release in here diff --git a/static/index.html b/static/index.html index 2717110..f40cba6 100644 --- a/static/index.html +++ b/static/index.html @@ -115,7 +115,7 @@

Oh no!

-
A error occured during installation. Please retry!
+
A error occurred during installation. Please retry!