swift-nio-redis icon indicating copy to clipboard operation
swift-nio-redis copied to clipboard

RESPError

Open epoll-j opened this issue 7 years ago • 3 comments

when i set a value, i get a error

let loopGroup = MultiThreadedEventLoopGroup(numThreads: System.coreCount)
let option = RedisClientOptions(port: 6379, host: "127.0.0.1", password: "1234567", database: nil, eventLoopGroup: loopGroup)
let client = RedisClient(options: option)

client.set("aa", "11") { (error, esp) in
    print(error)
    print(esp)
}

it will print

nil
Optional(<Error: RESPError(_storage: NIORedis.RESPError.(_Storage in _00741320934968E7EEA61F1326A5517D))>)

epoll-j avatar May 31 '18 09:05 epoll-j

Can you print:

error?.code

and

error?.message

(I also added a better debug description to the head version)

Since you are passing a password, I think that this is probably the issue. The lib doesn't support them right now.

helje5 avatar May 31 '18 15:05 helje5

@helje5 error is nil, respValue is "<Error: RESPError(_storage: NIORedis.RESPError.(_Storage in _00741320934968E7EEA61F1326A5517D))>"

client.set("aa", "11") { (error, resp) in
    print(error) // nil
    print(resp) // <Error: RESPError(_storage: NIORedis.RESPError.(_Storage in _00741320934968E7EEA61F1326A5517D))>
}

epoll-j avatar Jun 02 '18 03:06 epoll-j

Oh right, sorry, I misread that. That is wrong for sure, I'll check.

helje5 avatar Jun 02 '18 15:06 helje5