Skip to content

Commit

Permalink
add exception return code 472 and 473 (#220)
Browse files Browse the repository at this point in the history
* add exception return code 472 and 473

https://developer.hashicorp.com/vault/api-docs#http-status-codes

* fix syntax
  • Loading branch information
yanjunding authored Jul 28, 2023
1 parent 3623721 commit 81fba62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func isResponseError(req *http.Request, resp *http.Response) *ResponseError {
return nil
}

// 472 & 473 are returned by (performance/secondary) standby instances for /sys/health requests and should
// not be treated as an error
if (resp.StatusCode == 472 || resp.StatusCode == 473) && req.URL.Path == "/v1/sys/health" {
return nil
}

responseError := &ResponseError{
StatusCode: resp.StatusCode,
OriginalRequest: req,
Expand Down

0 comments on commit 81fba62

Please sign in to comment.