diff options
Diffstat (limited to 'stats_module')
-rw-r--r-- | stats_module/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/stats_module/src/lib.rs b/stats_module/src/lib.rs index 18a7c2b..ba9d199 100644 --- a/stats_module/src/lib.rs +++ b/stats_module/src/lib.rs @@ -9,7 +9,11 @@ extern "C" fn cgi_handle(req: *const ffi::ModuleRequest) -> *const ffi::ModuleRe let request = Request::from_mod_request(req); let db = if let Some(path) = request.header("CORGI_STATS_DB") { - Connection::open(path).unwrap() + if let Ok(db) = Connection::open(path) { + db + } else { + return make_error(500, "failed to open database"); + } } else { return make_error(500, "could not open stats database"); }; |