Comments (1)
I believe this is due to the underlying redis client. You can reproduce it by creating a client without using this library at all:
const { createClient } = require("redis");
const redis = createClient({ host: "127.0.0.1", port: 9898 }); // 9898 is just a port redis _isn't_ listening on
redis.ping((err, reply) => {
console.log({ err, reply });
});
👆 this exits with an unhandled ECONNREFUSED
error.
Their docs have some suggestions about what to do to handle connection problems: https://www.npmjs.com/package/redis#connection-and-other-events - I'd suggest trying having a look through them. If you think something's missing it probably makes sense to open an issue there. If it isn't fixed there, feel free to comment here or open another issue requesting a workaround. But I don't think it's necessary - your approach of adding a global error handler seems sensible to me. It shouldn't suppress all errors:
const { createHandyClient } = require("handy-redis");
const client = createHandyClient();
client.redis.on("error", err => {
console.log("global error: " + err);
});
client
.set("foo", "bar", ["EX", "NotANumberSoShouldResultInAnError"])
.then(console.log)
.catch(err => console.log("scoped error:" + err));
👆 prints scoped error: ReplyError: ERR value is not an integer or out of range
from handy-redis.
Related Issues (20)
- How to add command ? HOT 2
- missing end function HOT 1
- Support redis-mock HOT 2
- How to use SCRIPT LOAD? HOT 2
- Dependency Dashboard
- SPOP return was string[] in 1.x, now it is string, but it can return an Array HOT 3
- Multi Type definition issue HOT 2
- .lpos is not a function HOT 2
- Overloaded multi commands have incorrect type HOT 3
- wrong direction in npm page HOT 4
- Action Required: Fix Renovate Configuration
- Multi commands pass an array to the underlying redis function HOT 2
- TypeError: net.isIP is not a function HOT 1
- "XXXX can't be processed. The connection is already closed." HOT 1
- Scan has `unknown` return type
- zrevrangebyscore functions return unknown[] where zrangebyscore functions return string[]
- Cannot redeclare block-scoped variable 'addCommand' HOT 5
- GEOSEARCH support
- ERR syntax error when using SET
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handy-redis.