feat: warn or exit on config file parse errors
The relay will now fail to start if an invalid config file is explicitly provided. If the file was read implicitly from the current directory, a warning will be provided, but the relay will still startup.
This commit is contained in:
@@ -20,7 +20,7 @@ pub fn main() -> Result<()> {
|
||||
let _trace_sub = tracing_subscriber::fmt::try_init();
|
||||
println!("Nostr-rs-relay Bulk Loader");
|
||||
// check for a database file, or create one.
|
||||
let settings = config::Settings::new(&None);
|
||||
let settings = config::Settings::new(&None)?;
|
||||
if !Path::new(&settings.database.data_directory).is_dir() {
|
||||
info!("Database directory does not exist");
|
||||
return Err(Error::DatabaseDirError);
|
||||
|
||||
Reference in New Issue
Block a user