Comparing version 0.0.17 to 0.0.18
@@ -50,7 +50,8 @@ /* | ||
ralUtil.merge(conf, options); | ||
this.doRequest(); | ||
this.on('retry', function(err){ | ||
if (this._retryTimes >= conf.retry){ | ||
me.emit('error', err); | ||
process.nextTick(function(){ | ||
me.emit('error', err); | ||
}); | ||
}else{ | ||
@@ -63,3 +64,5 @@ this._retryTimes ++; | ||
} | ||
}) | ||
}); | ||
this.doRequest(); | ||
} | ||
@@ -192,6 +195,3 @@ } | ||
}catch(err){ | ||
//delay error trigger to let user caught error | ||
process.nextTick(function(){ | ||
onError(err); | ||
}); | ||
onError(err); | ||
return; | ||
@@ -218,6 +218,3 @@ } | ||
}catch(err){ | ||
//delay error trigger to let user caught error | ||
process.nextTick(function(){ | ||
onError(err); | ||
}); | ||
onError(err); | ||
return; | ||
@@ -256,2 +253,3 @@ } | ||
RalRunner.prototype.onError = function(err){ | ||
var me = this; | ||
clearTimeout(this.timeout); | ||
@@ -261,3 +259,5 @@ var info = this.getLogInfo(); | ||
logger.warning('request failed ' + ralUtil.qs(info)); | ||
this.emit('error', err); | ||
process.nextTick(function(){ | ||
me.emit('error', err); | ||
}); | ||
}; | ||
@@ -264,0 +264,0 @@ |
{ | ||
"name": "node-ral", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "a rpc client for node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
250773
6790