mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-02 05:57:46 +09:00
Check all errors for db.Save
This commit is contained in:
@@ -57,7 +57,10 @@ func (h *Headscale) CreateAPIKey(
|
||||
Hash: hash,
|
||||
Expiration: expiration,
|
||||
}
|
||||
h.db.Save(&key)
|
||||
|
||||
if err := h.db.Save(&key).Error; err != nil {
|
||||
return "", nil, fmt.Errorf("failed to save API key to database: %w", err)
|
||||
}
|
||||
|
||||
return keyStr, &key, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user