refactor: add err check in create tags

This commit is contained in:
Marin Salinas 2019-04-15 13:58:02 -05:00 committed by Megan Marsh
parent 653bf24211
commit 6820806436
1 changed files with 6 additions and 1 deletions

View File

@ -96,7 +96,12 @@ func (s *StepCreateVolume) Run(ctx context.Context, state multistep.StateBag) mu
//Create tags for volume
if len(volTags) > 0 {
osccommon.CreateTags(oapiconn, s.volumeId, ui, volTags)
if err := osccommon.CreateTags(oapiconn, s.volumeId, ui, volTags); err != nil {
err := fmt.Errorf("Error creating tags for volume: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
}
// Wait for the volume to become ready