Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Jul 24, 2024
1 parent 80b19ac commit fbdf7c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions reflect/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import (
"fmt"
)

// FieldNotKnown report field not found.
type FieldNotKnown struct {
// FieldNotValid report field not valid.
type FieldNotValid struct {
Kind string
Name string
}

func (e *FieldNotKnown) Error() string {
func (e *FieldNotValid) Error() string {
return fmt.Sprintf(
"(%s) '%s' not known.",
"(%s) '%s' not valid.",
e.Kind,
e.Name)
}

func (e *FieldNotKnown) Is(err error) (matched bool) {
var inst *FieldNotKnown
func (e *FieldNotValid) Is(err error) (matched bool) {
var inst *FieldNotValid
matched = errors.As(err, &inst)
return
}
2 changes: 1 addition & 1 deletion reflect/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func HasFields(m any, in ...string) (out []string, err error) {
for _, name := range in {
_, found := mp[name]
if !found {
err = &FieldNotKnown{
err = &FieldNotValid{
Kind: NameOf(m),
Name: name,
}
Expand Down

0 comments on commit fbdf7c4

Please sign in to comment.