2023-03-02 15:07:50 +00:00
|
|
|
package errors
|
|
|
|
|
2023-05-04 14:11:19 +00:00
|
|
|
import "errors"
|
|
|
|
|
2023-03-02 15:07:50 +00:00
|
|
|
type InvalidPayloadError struct {
|
|
|
|
msg string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *InvalidPayloadError) Error() string {
|
|
|
|
return e.msg
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewInvalidPayloadError(msg string) *InvalidPayloadError {
|
|
|
|
return &InvalidPayloadError{msg: msg}
|
|
|
|
}
|
2023-05-04 14:11:19 +00:00
|
|
|
|
|
|
|
func IsInvalidPayloadError(err error) bool {
|
|
|
|
var payloadError *InvalidPayloadError
|
|
|
|
return errors.As(err, &payloadError)
|
|
|
|
}
|