mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
api: provide more detail on ACL bootstrap request error (#14629)
This commit is contained in:
3
.github/14629.txt
vendored
Normal file
3
.github/14629.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:improvement
|
||||
api: return a more descriptive error when /v1/acl/bootstrap fails to decode request body
|
||||
```
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user