Subscribe errors not returned
Expected behavior
redis.subscribe(...).whenComplete {}
should get the error returned from Redis.
Actual behavior
redis.subscribe(...).whenComplete {}
fulfilled and there is no way developers can know when subscribe
command fails.
Steps to reproduce
- Disable SUBSCRIBE/PSUBSCRIBE commands on a Redis server
- Run
redis.subscribe(...).whenComplete {}
I think there are two possible solutions:
- Besides onSubscribe and onUnsubscribe, also accept a onError handler so can be called when SUBSCRIBE command fails.
- The future of the
subscribe
andpsubscribe
commands should be fulfilled with a RedisError.
RediStack version/commit hash
swift --version
)
Swift Version (output of 5.5
uname -a
)
OS version (output of Darwin Zihuas-M1-Book 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64