Check all errors for db.Save
This commit is contained in:
parent
405de9e0f8
commit
52cc3bc8eb
4 changed files with 45 additions and 13 deletions
|
@ -1,6 +1,8 @@
|
|||
package headscale
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"inet.af/netaddr"
|
||||
)
|
||||
|
||||
|
@ -108,7 +110,10 @@ func (h *Headscale) EnableNodeRoute(
|
|||
}
|
||||
|
||||
machine.EnabledRoutes = enabledRoutes
|
||||
h.db.Save(&machine)
|
||||
|
||||
if err := h.db.Save(&machine).Error; err != nil {
|
||||
return fmt.Errorf("failed to update node routes in the database: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue