mirror of https://github.com/go-redis/redis.git
Correctly parse EVAL response containing customized error (#710)
* always parse all content in an array including error
This commit is contained in:
parent
daab7c60d0
commit
4598ed0eac
|
@ -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"}))
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue