mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-08 10:11:30 -06:00
Use err!() instead of panic!() for unrecognised DATABASE_URL
Follow the established codebase convention where configuration validation errors use err!() to propagate gracefully, rather than panic!(). The error propagates through from_config() and is caught by create_db_pool() which logs and calls exit(1).
This commit is contained in:
parent
df56449823
commit
93f2e4aead
@ -288,12 +288,12 @@ impl DbConnType {
|
||||
if std::path::Path::new(url).exists() {
|
||||
return Ok(DbConnType::Sqlite);
|
||||
}
|
||||
panic!(
|
||||
err!(format!(
|
||||
"`DATABASE_URL` does not match any known database scheme (mysql://, postgresql://, sqlite://) \
|
||||
and no existing SQLite database was found at '{url}'. \
|
||||
If you intend to use SQLite, use an explicit `sqlite://` prefix in your `DATABASE_URL`. \
|
||||
Otherwise, check your DATABASE_URL for typos or quoting issues."
|
||||
);
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(not(sqlite))]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user