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:
David Allen 2025-02-06 13:02:51 -07:00 committed by GitHub
commit 9ef3f86f70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,10 @@ func CreateScannedAssetIfNotExists(path string) (*sqlx.DB, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to open database: %v", err) 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 return db, nil
} }