diff options
Diffstat (limited to 'server/src')
| -rw-r--r-- | server/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/main.rs b/server/src/main.rs index 37d71f2..db02c29 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -8,7 +8,7 @@ #![recursion_limit = "4096"] use crate::{auth::token::SessionKey, logger::setup_logger}; -use anyhow::Result; +use anyhow::{Result, anyhow}; use jellycache::Cache; use jellydb::Database; use log::{error, info}; @@ -67,7 +67,9 @@ pub struct Config { } pub fn create_state() -> Result<Arc<State>> { - let config_path = args().nth(1).unwrap(); + let config_path = args() + .nth(1) + .ok_or(anyhow!("first argument (config path) missing"))?; let config: Config = serde_yaml_ng::from_str(&read_to_string(config_path)?)?; let cache_storage = jellykv::rocksdb::new(&config.cache_path)?; |