1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Improve error stacks in development and debug mode

This commit is contained in:
Ruben Bridgewater
2016-05-29 01:24:26 +02:00
parent ce44213d65
commit 2c6e1e0cc0
4 changed files with 41 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
'use strict';
var debug_mode = require('../').debug_mode;
var betterStackTraces = process.env.NODE_ENV && process.env.NODE_ENV.toUpperCase() === 'DEVELOPMENT' || debug_mode;
function Command (command, args, callback, call_on_write) {
this.command = command;
@@ -7,6 +9,9 @@ function Command (command, args, callback, call_on_write) {
this.buffer_args = false;
this.callback = callback;
this.call_on_write = call_on_write;
if (betterStackTraces) {
this.error = new Error();
}
}
module.exports = Command;