Implement code review changes

This commit is contained in:
John Baublitz
2018-05-25 14:14:33 -04:00
committed by bergquist
parent 5c5951bc42
commit bdf433594a
6 changed files with 33 additions and 21 deletions

View File

@@ -148,8 +148,9 @@ func CreateAlertNotificationCommand(cmd *m.CreateAlertNotificationCommand) error
return fmt.Errorf("Alert notification frequency required")
}
frequency, err_convert := time.ParseDuration(cmd.Frequency)
if err_convert != nil {
var frequency time.Duration
frequency, err = time.ParseDuration(cmd.Frequency)
if err != nil {
return err
}
@@ -200,7 +201,7 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
current.NotifyOnce = cmd.NotifyOnce
if cmd.Frequency == "" {
return fmt.Errorf("Alert notification frequency required")
return m.ErrNotificationFrequencyNotFound
}
frequency, err_convert := time.ParseDuration(cmd.Frequency)