Skip to content

Commit

Permalink
api: provide more detail on ACL bootstrap request error (#14629)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed Sep 21, 2022
1 parent 54474a9 commit ddeeb10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/14629.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
api: return a more descriptive error when /v1/acl/bootstrap fails to decode request body
```
3 changes: 2 additions & 1 deletion command/agent/acl_endpoint.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package agent

import (
"fmt"
"net/http"
"strings"

Expand Down Expand Up @@ -142,7 +143,7 @@ func (s *HTTPServer) ACLTokenBootstrap(resp http.ResponseWriter, req *http.Reque

if req.ContentLength != 0 {
if err := decodeBody(req, &args); err != nil {
return nil, CodedError(400, err.Error())
return nil, CodedError(400, fmt.Sprintf("failed to decode request body: %s", err))
}
}

Expand Down

0 comments on commit ddeeb10

Please sign in to comment.