Skip to content

Commit

Permalink
cmd: Resolves panic when network fails in "rules import"
Browse files Browse the repository at this point in the history
Signed-off-by: arekkas <[email protected]>
  • Loading branch information
arekkas authored and arekkas committed Aug 9, 2018
1 parent 7505b71 commit 078542a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/rules_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ Usage example:
client := oathkeeper.NewSDK(endpoint)

shouldUpdate := false
if _, response, _ := client.GetRule(r.ID); err == nil && response.StatusCode == http.StatusOK {
if _, response, err := client.GetRule(r.ID); err != nil {
must(err, "Unable to call endpoint %s because %s", endpoint, err)
} else if response.StatusCode == http.StatusOK {
shouldUpdate = true
}

Expand Down

0 comments on commit 078542a

Please sign in to comment.