File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
backend/plugins/zentao/models Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -24,4 +24,5 @@ type ApiAccessTokenRequest struct {
2424
2525type ApiAccessTokenResponse struct {
2626 Token string `json:"token"`
27+ Error string `json:"error"`
2728}
Original file line number Diff line number Diff line change @@ -50,7 +50,11 @@ func (connection ZentaoConn) PrepareApiClient(apiClient plugin.ApiClient) errors
5050 return errors .HttpStatus (http .StatusBadRequest ).Wrap (err , "failed UnmarshalResponse for tokenResBody" )
5151 }
5252 if tokenResBody .Token == "" {
53- return errors .HttpStatus (http .StatusBadRequest ).New ("failed to request access token" )
53+ msg := "failed to request access token"
54+ if tokenResBody .Error != "" {
55+ msg = tokenResBody .Error
56+ }
57+ return errors .HttpStatus (http .StatusBadRequest ).New (msg )
5458 }
5559 apiClient .SetHeaders (map [string ]string {
5660 "Token" : fmt .Sprintf ("%v" , tokenResBody .Token ),
You can’t perform that action at this time.
0 commit comments