Skip to content

Commit

Permalink
PMM-7 Service accounts better error. (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka authored Apr 26, 2024
1 parent f2a6d70 commit a9b9670
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/services/serviceaccounts/api/api.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api

import (
"fmt"
"net/http"
"strconv"

Expand Down Expand Up @@ -115,7 +116,7 @@ func (api *ServiceAccountsAPI) CreateServiceAccount(c *contextmodel.ReqContext)
if _, err := api.permissionService.SetUserPermission(c.Req.Context(),
c.SignedInUser.GetOrgID(), accesscontrol.User{ID: userID},
strconv.FormatInt(serviceAccount.Id, 10), "Admin"); err != nil {
return response.Error(http.StatusInternalServerError, "Failed to set permissions for service account creator", err)
return response.Error(http.StatusInternalServerError, fmt.Sprintf("Failed to set permissions for service account creator %s", err.Error()), err)
}
}

Expand Down

0 comments on commit a9b9670

Please sign in to comment.