From ad3980e4d0d23ece8d9dbdad028fe960a6d32a07 Mon Sep 17 00:00:00 2001 From: Kazushi Kitaya Date: Thu, 24 Oct 2019 17:19:02 +0900 Subject: [PATCH] replace outdated `ErrInvalidTypeConversion` in `docs/objects.md` (#223) --- docs/objects.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/objects.md b/docs/objects.md index 9756106..900dabb 100644 --- a/docs/objects.md +++ b/docs/objects.md @@ -249,7 +249,7 @@ func (o *StringArray) IndexGet(index objects.Object) (objects.Object, error) { func (o *StringArray) IndexSet(index, value objects.Object) error { strVal, ok := objects.ToString(value) if !ok { - return objects.ErrInvalidTypeConversion + return objects.ErrInvalidIndexValueType } intIdx, ok := index.(*objects.Int) @@ -276,7 +276,11 @@ func (o *StringArray) Call(args ...objects.Object) (ret objects.Object, err erro s1, ok := objects.ToString(args[0]) if !ok { - return nil, objects.ErrInvalidTypeConversion + return nil, objects.ErrInvalidArgumentType{ + Name: "first", + Expected: "string", + Found: args[0].TypeName(), + } } for i, v := range o.Value {