mirror of
https://github.com/CDrummond/bliss-analyser.git
synced 2025-04-08 05:00:02 +03:00
Show error if can't open/create database
This commit is contained in:
parent
7fb2e66c58
commit
94ef2e2c1f
@ -2,6 +2,7 @@
|
||||
-----
|
||||
1. Tidy up code, thanks to Serial-ATA
|
||||
2. Update version of tag reader library, should now support ID3v2 in FLAC.
|
||||
3. Show error message if can't open, or create, database file.
|
||||
|
||||
0.1.0
|
||||
-----
|
||||
|
12
src/db.rs
12
src/db.rs
@ -51,8 +51,16 @@ pub struct Db {
|
||||
|
||||
impl Db {
|
||||
pub fn new(path: &String) -> Self {
|
||||
Self {
|
||||
conn: Connection::open(path).unwrap(),
|
||||
match Connection::open(path) {
|
||||
Ok(conn) => {
|
||||
Self {
|
||||
conn: conn,
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
log::error!("Failed top open/create database. {}", e);
|
||||
process::exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user