Skip to content

Commit

Permalink
better ARI result handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulexus committed Sep 5, 2018
1 parent 2bd1240 commit dfe1a9c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
set -e
#!/bin/bash -e
dep ensure
#gometalinter --skip test --skip defaults --cyclo-over=15 --deadline=90s --vendor ./...
golangci-lint run
Expand Down
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,16 @@ func reload(username, secret, modules string) (err error) {
ret.Body.Close() // nolint

switch ret.StatusCode {
case http.StatusNoContent:
continue
case http.StatusNotFound:
return errors.Errorf("module %s not already loaded", m)
case http.StatusUnauthorized:
return errors.Errorf("module %s failed to reload due bad authentication")
case 409:
return errors.Errorf("module %s could not be reloaded", m)
default:
return errors.Errorf("module %s reload failed: %s", m, ret.Status)
}
}

Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e

# Only run if we are inside Travis-CI
if [ ! -e $CI ]; then
Expand Down

0 comments on commit dfe1a9c

Please sign in to comment.