fix: unhandled errors

Signed-off-by: skidoodle <contact@albert.lol>
This commit is contained in:
2026-01-18 21:19:42 +01:00
parent 73ee7a9a14
commit 8b638275b8
5 changed files with 160 additions and 47 deletions
+10 -2
View File
@@ -17,7 +17,11 @@ func TestInitDB(t *testing.T) {
if err != nil {
t.Fatalf("InitDB failed: %v", err)
}
defer db.Close()
defer func() {
if err := db.Close(); err != nil {
t.Errorf("Failed to close DB: %v", err)
}
}()
dbPath := filepath.Join(tmpDir, DBFileName)
if _, err := os.Stat(dbPath); os.IsNotExist(err) {
@@ -42,7 +46,11 @@ func TestDB_MetadataLifecycle(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer db.Close()
defer func() {
if err := db.Close(); err != nil {
t.Errorf("Failed to close DB: %v", err)
}
}()
app := &App{
Conf: Config{StorageDir: tmpDir, MaxMB: 100},