mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +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
|
@ -35,13 +35,13 @@ func (handler *Handler) webhookInvoke(w http.ResponseWriter, r *http.Request) *h
|
|||
statusCode = http.StatusNotFound
|
||||
}
|
||||
|
||||
return &httperror.HandlerError{StatusCode: statusCode, Message: "Unable to find the stack by webhook ID", Err: err}
|
||||
return httperror.NewError(statusCode, "Unable to find the stack by webhook ID", err)
|
||||
}
|
||||
|
||||
if err = deployments.RedeployWhenChanged(stack.ID, handler.StackDeployer, handler.DataStore, handler.GitService); err != nil {
|
||||
var StackAuthorMissingErr *deployments.StackAuthorMissingErr
|
||||
if errors.As(err, &StackAuthorMissingErr) {
|
||||
return &httperror.HandlerError{StatusCode: http.StatusConflict, Message: "Autoupdate for the stack isn't available", Err: err}
|
||||
return httperror.Conflict("Autoupdate for the stack isn't available", err)
|
||||
}
|
||||
|
||||
return httperror.InternalServerError("Failed to update the stack", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue