You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Improve error handling
Added individual error classes Don't silently fail for commands without callback from now on General polishing (e.g. better error messages) Fix typos
This commit is contained in:
@@ -47,10 +47,10 @@ RedisClient.prototype.send_command = RedisClient.prototype.sendCommand = functio
|
||||
RedisClient.prototype.end = function (flush) {
|
||||
// Flush queue if wanted
|
||||
if (flush) {
|
||||
var err = new Error("The command can't be processed. The connection has already been closed.");
|
||||
err.code = 'NR_OFFLINE';
|
||||
this.flush_and_error(err);
|
||||
// TODO: Emit an error in case a command did not have a callback
|
||||
this.flush_and_error({
|
||||
message: 'Connection forcefully ended and command aborted.',
|
||||
code: 'NR_CLOSED'
|
||||
});
|
||||
} else if (arguments.length === 0) {
|
||||
this.warn(
|
||||
'Using .end() without the flush parameter is deprecated and throws from v.3.0.0 on.\n' +
|
||||
|
Reference in New Issue
Block a user