mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
Merge pull request #72 from OpenCHAMI/fix-handling-cache-create-error
fix: change db.MustExec to db.Exec and handle error
This commit is contained in:
commit
9ef3f86f70
1 changed files with 4 additions and 1 deletions
5
internal/cache/sqlite/sqlite.go
vendored
5
internal/cache/sqlite/sqlite.go
vendored
|
|
@ -27,7 +27,10 @@ func CreateScannedAssetIfNotExists(path string) (*sqlx.DB, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to open database: %v", err)
|
||||
}
|
||||
db.MustExec(schema)
|
||||
_, err = db.Exec(schema)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create scanned assets cache: %v", err)
|
||||
}
|
||||
return db, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue