Skip to content

Commit

Permalink
Add yav.ErrRequired shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
SladeThe committed Oct 9, 2023
1 parent e600238 commit ce930de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func IsError(err error) bool {
return errors.As(err, &validationErr)
}

func ErrRequired(name string) Error {
return Error{CheckName: CheckNameRequired, ValueName: name}
}

func (err Error) Is(target error) bool {
var validationErr Error

Expand Down

0 comments on commit ce930de

Please sign in to comment.