1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

chore(edgestacks): clean up EE-4851 (#8260)

This commit is contained in:
andres-portainer 2023-01-03 10:49:29 -03:00 committed by GitHub
parent 137ce37096
commit 2fc518f221
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 35 deletions

View file

@ -60,10 +60,8 @@ func (handler *Handler) edgeStackStatusUpdate(w http.ResponseWriter, r *http.Req
}
endpoint, err := handler.DataStore.Endpoint().Endpoint(payload.EndpointID)
if handler.DataStore.IsErrObjectNotFound(err) {
return httperror.NotFound("Unable to find an environment with the specified identifier inside the database", err)
} else if err != nil {
return httperror.InternalServerError("Unable to find an environment with the specified identifier inside the database", err)
if err != nil {
return handler.handlerDBErr(err, "Unable to find an environment with the specified identifier inside the database")
}
err = handler.requestBouncer.AuthorizedEdgeEndpointOperation(r, endpoint)
@ -98,10 +96,8 @@ func (handler *Handler) edgeStackStatusUpdate(w http.ResponseWriter, r *http.Req
stack = *edgeStack
})
if handler.DataStore.IsErrObjectNotFound(err) {
return httperror.NotFound("Unable to find a stack with the specified identifier inside the database", err)
} else if err != nil {
return httperror.InternalServerError("Unable to persist the stack changes inside the database", err)
if err != nil {
return handler.handlerDBErr(err, "Unable to persist the stack changes inside the database")
}
return response.JSON(w, stack)