Skip to content

Commit

Permalink
Callback also in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
enricostara committed May 13, 2015
1 parent 2b10456 commit 011d3f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/net/encrypted-rpc-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ EncryptedRpcChannel.prototype._call = function (reqMsg) {
var callback = this._callbackMap[reqMsg.messageId];
try {
this.constructor.super_.prototype._call.call(this, reqMsg, function (ex, result, duration) {
if(ex) {
logger.error(ex.stack);
if(callback) {
callback(ex);
return;
}
}
logger.info('Call of \'%s\' took %sms', reqMsg.body.typeName, duration);
self._parser.parse(result, duration);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "telegram-mt-node",
"version": "0.7.4",
"version": "0.7.5",
"description": "Telegram MTProto library",
"keywords": [
"telegram",
Expand Down

0 comments on commit 011d3f2

Please sign in to comment.