1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

refactor(server): use httperror.NewError instead of struct [EE-6189] (#10398)

This commit is contained in:
Chaim Lev-Ari 2023-10-05 11:26:24 +03:00 committed by GitHub
parent da346cba60
commit 95f3cf6e5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 39 additions and 35 deletions

View file

@ -85,7 +85,7 @@ func (handler *Handler) stackStart(w http.ResponseWriter, r *http.Request) *http
}
if !isUnique {
errorMessage := fmt.Sprintf("A stack with the name '%s' is already running", stack.Name)
return &httperror.HandlerError{StatusCode: http.StatusConflict, Message: errorMessage, Err: errors.New(errorMessage)}
return httperror.Conflict(errorMessage, errors.New(errorMessage))
}
resourceControl, err := handler.DataStore.ResourceControl().ResourceControlByResourceIDAndType(stackutils.ResourceControlID(stack.EndpointID, stack.Name), portainer.StackResourceControl)