Check errors of more database calls

This commit is contained in:
Kristoffer Dalby
2022-05-30 15:39:24 +02:00
parent a1837a4d69
commit a09633e859
3 changed files with 28 additions and 4 deletions

4
db.go
View File

@@ -175,7 +175,9 @@ func (h *Headscale) setValue(key string, value string) error {
return nil
}
h.db.Create(keyValue)
if err := h.db.Create(keyValue).Error; err != nil {
return fmt.Errorf("failed to create key value pair in the database: %w", err)
}
return nil
}