redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.34k stars 1.19k forks source link

ReplyError NOGROUP missing code property #839

Open LinusU opened 5 years ago

LinusU commented 5 years ago

According to this documentation, there should be a code property on the ReplyError class:

https://www.npmjs.com/package/redis-errors#replyerror

When trying a xreadgroup and getting back a NOGROUP error I'm not able to read that from .code 🤔

try {
  await redis.xreadgroup('GROUP', 'foobar1', 'foobar2', 'BLOCK', 5000, 'STREAMS', 'foobar3', 0)
} catch (err) {
  console.error(err.code) // undefined
}
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed.

LinusU commented 5 years ago

I think this is still relevant 😕

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed.

Janpot commented 5 years ago

Also, according to those docs

All errors returned by NodeRedis use own Error classes. You can distinguish different errors easily by checking for these classes.

Yet, I'm seeing plain Errors of Error: Connection is closed. when trying to .end(true) a connection that is already closed.