From dfe1a9c48ba07f0a2fd57732267772808353b512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20C=20McCord?= Date: Tue, 4 Sep 2018 20:29:23 -0400 Subject: [PATCH] better ARI result handling --- check.sh | 3 +-- main.go | 5 +++++ release.sh | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/check.sh b/check.sh index 91cc546..a0cdf51 100755 --- a/check.sh +++ b/check.sh @@ -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 diff --git a/main.go b/main.go index 69f0648..180b4f3 100644 --- a/main.go +++ b/main.go @@ -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) } } diff --git a/release.sh b/release.sh index d84e1d6..57377de 100755 --- a/release.sh +++ b/release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # Only run if we are inside Travis-CI if [ ! -e $CI ]; then