mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
refactor(server): use httperror.NewError instead of struct [EE-6189] (#10398)
This commit is contained in:
parent
da346cba60
commit
95f3cf6e5b
26 changed files with 39 additions and 35 deletions
|
@ -59,7 +59,7 @@ func deleteEdgeGroup(tx dataservices.DataStoreTx, ID portainer.EdgeGroupID) erro
|
|||
for _, edgeStack := range edgeStacks {
|
||||
for _, groupID := range edgeStack.EdgeGroups {
|
||||
if groupID == ID {
|
||||
return httperror.NewError(http.StatusConflict, "Edge group is used by an Edge stack", errors.New("edge group is used by an Edge stack"))
|
||||
return httperror.Conflict("Edge group is used by an Edge stack", errors.New("edge group is used by an Edge stack"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ func deleteEdgeGroup(tx dataservices.DataStoreTx, ID portainer.EdgeGroupID) erro
|
|||
for _, edgeJob := range edgeJobs {
|
||||
for _, groupID := range edgeJob.EdgeGroups {
|
||||
if groupID == ID {
|
||||
return httperror.NewError(http.StatusConflict, "Edge group is used by an Edge job", errors.New("edge group is used by an Edge job"))
|
||||
return httperror.Conflict("Edge group is used by an Edge job", errors.New("edge group is used by an Edge job"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue