aboutsummaryrefslogtreecommitdiffstats
path: root/license-generator/src/errors.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-11-09 19:47:46 +0100
committerTeddy Wing2018-11-09 19:47:46 +0100
commit6aa6c70af607ede55f9dafef7278b192a2a6b9d0 (patch)
tree1afcc1fbe7479c8c2028768f84fce2f2658083dd /license-generator/src/errors.rs
parente8aa1429fa45957a2174446df64b62d407544d8b (diff)
downloaddome-key-web-6aa6c70af607ede55f9dafef7278b192a2a6b9d0.tar.bz2
Set up a file logger
Get a file path from the `LOG_FILE` environment variable and use it for log output. Call `database::get_database_connection()` and log the error if it fails. Worried about exiting early from the FastCGI program, as DreamHost says this causes problems (https://help.dreamhost.com/hc/en-us/articles/217298967). But I don't see how the program can continue without a database connection. Return a `Result` from `main()` because it's easier to use the `?` operator for errors that happen before logging is initialised.
Diffstat (limited to 'license-generator/src/errors.rs')
-rw-r--r--license-generator/src/errors.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/license-generator/src/errors.rs b/license-generator/src/errors.rs
index 29f25ca..0a28341 100644
--- a/license-generator/src/errors.rs
+++ b/license-generator/src/errors.rs
@@ -1,9 +1,12 @@
+use log;
use mysql;
error_chain! {
foreign_links {
EnvVar(::std::env::VarError);
+ Io(::std::io::Error);
+ Log(log::SetLoggerError);
MySql(mysql::error::Error);
}
}