get rid of uneccessary expects/unwraps in open_upend; logging

feat/vaults
Tomáš Mládek 2021-04-19 00:34:01 +02:00
parent fedf417787
commit c2705d328d
1 changed files with 6 additions and 3 deletions

View File

@ -713,16 +713,19 @@ pub fn open_upend<P: AsRef<Path>>(dirpath: P, reinitialize: bool) -> Result<Open
enable_foreign_keys: true,
busy_timeout: Some(Duration::from_secs(30)),
}))
.build(manager)
.expect("Failed to create pool.");
.build(manager)?;
trace!("Pool created, running migrations...");
embedded_migrations::run_with_output(
&pool.get().unwrap(),
&pool.get()?,
&mut LoggerSink {
..Default::default()
},
)?;
trace!("Initializing types...");
initialize_types(&pool)?;
Ok(OpenResult { pool, new })