Skip to content

Commit

Permalink
throw error when credentials are needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Oct 18, 2018
1 parent 5db3df6 commit 64b83e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/fritzboxmetrics/fritzboxmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ func (a *Action) Call() (Result, error) {
if err != nil {
return nil, errors.Wrap(err, "could not roundtrip digest authentification")
}
if resp.StatusCode == http.StatusUnauthorized {
return nil, errors.New("authorization required")
}

data := new(bytes.Buffer)
data.ReadFrom(resp.Body)
Expand Down

0 comments on commit 64b83e3

Please sign in to comment.