mirror of
https://github.com/portainer/portainer.git
synced 2025-08-03 04:45:21 +02:00
refactor(edge/stacks): separate create by method [EE-4947] (#8898)
This commit is contained in:
parent
1ff19f8604
commit
426c132f97
15 changed files with 1225 additions and 1123 deletions
20
api/http/errors/conflict.go
Normal file
20
api/http/errors/conflict.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package errors
|
||||
|
||||
import "errors"
|
||||
|
||||
type ConflictError struct {
|
||||
msg string
|
||||
}
|
||||
|
||||
func (e *ConflictError) Error() string {
|
||||
return e.msg
|
||||
}
|
||||
|
||||
func NewConflictError(msg string) *ConflictError {
|
||||
return &ConflictError{msg: msg}
|
||||
}
|
||||
|
||||
func IsConflictError(err error) bool {
|
||||
var conflictError *ConflictError
|
||||
return errors.As(err, &conflictError)
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package errors
|
||||
|
||||
import "errors"
|
||||
|
||||
type InvalidPayloadError struct {
|
||||
msg string
|
||||
}
|
||||
|
@ -11,3 +13,8 @@ func (e *InvalidPayloadError) Error() string {
|
|||
func NewInvalidPayloadError(msg string) *InvalidPayloadError {
|
||||
return &InvalidPayloadError{msg: msg}
|
||||
}
|
||||
|
||||
func IsInvalidPayloadError(err error) bool {
|
||||
var payloadError *InvalidPayloadError
|
||||
return errors.As(err, &payloadError)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue