Skip to content

Commit

Permalink
Merge pull request #330 from ibartj/324-nested-errors
Browse files Browse the repository at this point in the history
adds descriptions to nested errors, should fix #324
  • Loading branch information
phpnode committed Jun 17, 2015
2 parents addffe3 + 34f6efc commit 5db8bed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/transport/binary/protocol19/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions lib/transport/binary/protocol26/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions lib/transport/binary/protocol28/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5db8bed

Please sign in to comment.