Skip to content

Commit

Permalink
Fix double delete message on not exsisting respurce (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarPetrov authored May 16, 2019
1 parent 258162e commit 8bddaa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/cmd/broker/delete_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (dbc *DeleteBrokerCmd) Run() error {
err := dbc.Client.DeleteBrokersByFieldQuery(fieldQuery)
if respErr, ok := err.(errors.ResponseError); ok && respErr.StatusCode == http.StatusNotFound{
output.PrintMessage(dbc.Output, "Service Broker(s) not found.\n")
return nil
} else if err != nil {
output.PrintMessage(dbc.Output, "Could not delete broker(s). Reason: ")
return err
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/platform/delete_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (dpc *DeletePlatformCmd) Run() error {
err := dpc.Client.DeletePlatformsByFieldQuery(fieldQuery)
if respErr, ok := err.(errors.ResponseError); ok && respErr.StatusCode == http.StatusNotFound{
output.PrintMessage(dpc.Output, "Platform(s) not found.\n")
return nil
} else if err != nil {
output.PrintMessage(dpc.Output, "Could not delete platform(s). Reason: ")
return err
Expand Down

0 comments on commit 8bddaa8

Please sign in to comment.