diff --git a/commands_test.go b/commands_test.go index 5b3ee97e..524c3ac7 100644 --- a/commands_test.go +++ b/commands_test.go @@ -10,6 +10,7 @@ import ( . "github.com/onsi/gomega" "github.com/go-redis/redis" + "github.com/go-redis/redis/internal" ) var _ = Describe("Commands", func() { @@ -2993,6 +2994,15 @@ var _ = Describe("Commands", func() { Expect(vals).To(Equal([]interface{}{"key", "hello"})) }) + It("returns all values after an error", func() { + vals, err := client.Eval( + `return {12, {err="error"}, "abc"}`, + nil, + ).Result() + Expect(err).NotTo(HaveOccurred()) + Expect(vals).To(Equal([]interface{}{int64(12), internal.RedisError("error"), "abc"})) + }) + }) }) diff --git a/parser.go b/parser.go index b378abc4..e77efeeb 100644 --- a/parser.go +++ b/parser.go @@ -17,7 +17,7 @@ func sliceParser(rd *proto.Reader, n int64) (interface{}, error) { if err == Nil { vals = append(vals, nil) } else if err != nil { - return nil, err + vals = append(vals, err) } else { switch vv := v.(type) { case []byte: