diff --git a/.github/14629.txt b/.github/14629.txt new file mode 100644 index 000000000000..0ee3d074b1cc --- /dev/null +++ b/.github/14629.txt @@ -0,0 +1,3 @@ +```release-note:improvement +api: return a more descriptive error when /v1/acl/bootstrap fails to decode request body +``` diff --git a/command/agent/acl_endpoint.go b/command/agent/acl_endpoint.go index 67942e86bf77..fb444b4e454d 100644 --- a/command/agent/acl_endpoint.go +++ b/command/agent/acl_endpoint.go @@ -1,6 +1,7 @@ package agent import ( + "fmt" "net/http" "strings" @@ -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)) } }