From 5cf9595afe1734224fe5048714c261416865f9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bartovsk=C3=BD?= Date: Tue, 16 Jun 2015 17:03:48 +0200 Subject: [PATCH 1/2] adds descriptions to nested errors, should fix #324 --- lib/transport/binary/protocol19/operation.js | 4 ++++ lib/transport/binary/protocol26/operation.js | 4 ++++ lib/transport/binary/protocol28/operation.js | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lib/transport/binary/protocol19/operation.js b/lib/transport/binary/protocol19/operation.js index 33a74e5..809038e 100644 --- a/lib/transport/binary/protocol19/operation.js +++ b/lib/transport/binary/protocol19/operation.js @@ -821,12 +821,16 @@ Operation.prototype.parseError = function (buffer, offset, context, fieldName, r var prev; if (data.hasMore) { prev = new errors.Request(); + prev.type = data.type; + prev.message = data.message err.previous.push(prev); this.stack.pop(); this.stack.push(prev); readItem.call(this); } else { + err.type = data.type; + err.message = data.message; this.readBytes('javaStackTrace', function (data) { this.readOps.push(function (data) { this.stack.pop(); diff --git a/lib/transport/binary/protocol26/operation.js b/lib/transport/binary/protocol26/operation.js index 33a74e5..809038e 100644 --- a/lib/transport/binary/protocol26/operation.js +++ b/lib/transport/binary/protocol26/operation.js @@ -821,12 +821,16 @@ Operation.prototype.parseError = function (buffer, offset, context, fieldName, r var prev; if (data.hasMore) { prev = new errors.Request(); + prev.type = data.type; + prev.message = data.message err.previous.push(prev); this.stack.pop(); this.stack.push(prev); readItem.call(this); } else { + err.type = data.type; + err.message = data.message; this.readBytes('javaStackTrace', function (data) { this.readOps.push(function (data) { this.stack.pop(); diff --git a/lib/transport/binary/protocol28/operation.js b/lib/transport/binary/protocol28/operation.js index da9f66a..9a75b4f 100644 --- a/lib/transport/binary/protocol28/operation.js +++ b/lib/transport/binary/protocol28/operation.js @@ -898,12 +898,16 @@ Operation.prototype.parseError = function (buffer, offset, context, fieldName, r var prev; if (data.hasMore) { prev = new errors.Request(); + prev.type = data.type; + prev.message = data.message; err.previous.push(prev); this.stack.pop(); this.stack.push(prev); readItem.call(this); } else { + err.type = data.type; + err.message = data.message; this.readBytes('javaStackTrace', function (data) { this.readOps.push(function (data) { this.stack.pop(); From 34f6efc494138fd512bf93bbd3064934f3f6b025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bartovsk=C3=BD?= Date: Wed, 17 Jun 2015 09:20:55 +0200 Subject: [PATCH 2/2] missing semicolon added --- lib/transport/binary/protocol19/operation.js | 2 +- lib/transport/binary/protocol26/operation.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transport/binary/protocol19/operation.js b/lib/transport/binary/protocol19/operation.js index 809038e..c109040 100644 --- a/lib/transport/binary/protocol19/operation.js +++ b/lib/transport/binary/protocol19/operation.js @@ -822,7 +822,7 @@ Operation.prototype.parseError = function (buffer, offset, context, fieldName, r if (data.hasMore) { prev = new errors.Request(); prev.type = data.type; - prev.message = data.message + prev.message = data.message; err.previous.push(prev); this.stack.pop(); this.stack.push(prev); diff --git a/lib/transport/binary/protocol26/operation.js b/lib/transport/binary/protocol26/operation.js index 809038e..c109040 100644 --- a/lib/transport/binary/protocol26/operation.js +++ b/lib/transport/binary/protocol26/operation.js @@ -822,7 +822,7 @@ Operation.prototype.parseError = function (buffer, offset, context, fieldName, r if (data.hasMore) { prev = new errors.Request(); prev.type = data.type; - prev.message = data.message + prev.message = data.message; err.previous.push(prev); this.stack.pop(); this.stack.push(prev);