Notification level validation should live in resolve method

This commit is contained in:
Frederik Ring
2026-01-16 09:25:46 +01:00
parent 3d8960a351
commit 75e47b4d85
2 changed files with 6 additions and 6 deletions

View File

@@ -240,6 +240,11 @@ func (c *Config) resolve() (reset func() error, warnings []string, err error) {
return
}
if _, ok := hookLevels[c.NotificationLevel]; !ok {
err = errwrap.Wrap(nil, fmt.Sprintf("unknown NOTIFICATION_LEVEL %s", c.NotificationLevel))
return
}
if c.BackupFilenameExpand {
c.BackupFilename = os.ExpandEnv(c.BackupFilename)
c.BackupLatestSymlink = os.ExpandEnv(c.BackupLatestSymlink)