mirror of https://github.com/portainer/portainer
21 lines
375 B
Go
21 lines
375 B
Go
package errors
|
|
|
|
import "errors"
|
|
|
|
type InvalidPayloadError struct {
|
|
msg string
|
|
}
|
|
|
|
func (e *InvalidPayloadError) Error() string {
|
|
return e.msg
|
|
}
|
|
|
|
func NewInvalidPayloadError(msg string) *InvalidPayloadError {
|
|
return &InvalidPayloadError{msg: msg}
|
|
}
|
|
|
|
func IsInvalidPayloadError(err error) bool {
|
|
var payloadError *InvalidPayloadError
|
|
return errors.As(err, &payloadError)
|
|
}
|