diff --git a/lib/transport/rest/protocol/deserializer.js b/lib/transport/rest/protocol/deserializer.js index cd09e0fc..34594f63 100644 --- a/lib/transport/rest/protocol/deserializer.js +++ b/lib/transport/rest/protocol/deserializer.js @@ -38,7 +38,7 @@ function deserializeDocument (serialized) { return res; } catch (e) { - throw new errors.Request(serialized); + throw new errors.Request(serialized + " error:" + e); } } diff --git a/test/database/database-record-test.js b/test/database/database-record-test.js index eecf582f..c5ca653a 100644 --- a/test/database/database-record-test.js +++ b/test/database/database-record-test.js @@ -141,8 +141,8 @@ describe("ODatabaseSession API - Record", function () { name: 'othertestuser', password: 'testpassword', status: 'ACTIVE', - linkedTest1: "#5:0", // defined link field - linkedTest2: "#5:1" // dynamic field + linkedTest1: "#6:0", // defined link field + linkedTest2: "#6:1" // dynamic field }) .bind(this) .then(function (obj) { @@ -160,13 +160,13 @@ describe("ODatabaseSession API - Record", function () { var serType = this.db.session().server.network.serializationType; if (version >= 33 && serType === 'onet_ser_v0') { - expect(record.linkedTest1.cluster).to.equal(5); + expect(record.linkedTest1.cluster).to.equal(6); expect(record.linkedTest1.position).to.equal(0); } else { expect(record.linkedTest1).to.equal(null); } expect(typeof record.linkedTest2).to.equal('string'); // because we did not pass a RID, this is not a link - record.linkedTest2.should.equal('#5:1'); + record.linkedTest2.should.equal('#6:1'); }); }); @@ -235,7 +235,7 @@ describe("ODatabaseSession API - Record", function () { // Fixed with binary protocol if (version >= 33 && serType === 'onet_ser_v0') { - expect(record.linkedTest1.cluster).to.equal(5); + expect(record.linkedTest1.cluster).to.equal(6); expect(record.linkedTest1.position).to.equal(0); } else { expect(record.linkedTest1).to.equal(null); @@ -243,7 +243,7 @@ describe("ODatabaseSession API - Record", function () { expect(typeof record.linkedTest2).to.equal('string'); // because we did not pass a RID, this is not a link - record.linkedTest2.should.equal('#5:1'); + record.linkedTest2.should.equal('#6:1'); }); }); diff --git a/test/db/record-test.js b/test/db/record-test.js index 3ca03c52..8b11182d 100644 --- a/test/db/record-test.js +++ b/test/db/record-test.js @@ -22,21 +22,21 @@ describe("Database API - Record", function () { describe('Db::record.get()', function () { it('should get the record with the given rid', function () { - return this.db.record.get('#5:0') + return this.db.record.get('#6:0') .then(function (record) { record['@class'].should.equal('OUser'); record['@rid'].should.have.properties({ - cluster: 5, + cluster: 6, position: 0 }); }); }); it('should get the record with a fetch plan', function () { - return this.db.record.get({'@rid': '#5:0'}, {fetchPlan: '*:-1'}) + return this.db.record.get({'@rid': '#6:0'}, {fetchPlan: '*:-1'}) .then(function (record) { record['@class'].should.equal('OUser'); record['@rid'].should.have.properties({ - cluster: 5, + cluster: 6, position: 0 }); record.roles.length.should.be.above(0); @@ -47,24 +47,24 @@ describe("Database API - Record", function () { describe('Db::record.get()', function () { it('should get records with the given rids', function () { - return this.db.record.get(['#5:0', '#5:1']) + return this.db.record.get(['#6:0', '#6:1']) .then(function (records) { records.forEach(function(record, i){ record['@class'].should.equal('OUser'); record['@rid'].should.have.properties({ - cluster: 5, + cluster: 6, position: i }); }); }); }); it('should get records with a fetch plan', function () { - return this.db.record.get([{'@rid': '#5:0'},{'@rid': '#5:1'}], {fetchPlan: '*:-1'}) + return this.db.record.get([{'@rid': '#6:0'},{'@rid': '#6:1'}], {fetchPlan: '*:-1'}) .then(function (records) { records.forEach(function(record, i){ record['@class'].should.equal('OUser'); record['@rid'].should.have.properties({ - cluster: 5, + cluster: 6, position: i }); record.roles.length.should.be.above(0); @@ -135,8 +135,8 @@ describe("Database API - Record", function () { name: 'othertestuser', password: 'testpassword', status: 'ACTIVE', - linkedTest1: "#5:0", // defined link field - linkedTest2: "#5:1" // dynamic field + linkedTest1: "#6:0", // defined link field + linkedTest2: "#6:1" // dynamic field }) .bind(this) .then(function (obj) { @@ -153,13 +153,13 @@ describe("Database API - Record", function () { var serType = this.db.server.transport.connection.protocol.constants.SERIALIZATION_FORMAT; if (version >= 33 && serType === 'onet_ser_v0') { - expect(record.linkedTest1.cluster).to.equal(5); + expect(record.linkedTest1.cluster).to.equal(6); expect(record.linkedTest1.position).to.equal(0); } else { expect(record.linkedTest1).to.equal(null); } expect(typeof record.linkedTest2).to.equal('string'); // because we did not pass a RID, this is not a link - record.linkedTest2.should.equal('#5:1'); + record.linkedTest2.should.equal('#6:1'); }); }); @@ -169,8 +169,8 @@ describe("Database API - Record", function () { name: 'othertestuser2', password: 'testpassword', status: 'ACTIVE', - linkedTest1: new LIB.RID("#5:0"), // defined field - linkedTest2: new LIB.RID("#5:1") // dynamic field + linkedTest1: new LIB.RID("#6:0"), // defined field + linkedTest2: new LIB.RID("#6:1") // dynamic field }) .bind(this) .then(function (obj) { @@ -228,7 +228,7 @@ describe("Database API - Record", function () { // Fixed with binary protocol if (version >= 33 && serType === 'onet_ser_v0') { - expect(record.linkedTest1.cluster).to.equal(5); + expect(record.linkedTest1.cluster).to.equal(6); expect(record.linkedTest1.position).to.equal(0); } else { expect(record.linkedTest1).to.equal(null); @@ -236,7 +236,7 @@ describe("Database API - Record", function () { expect(typeof record.linkedTest2).to.equal('string'); // because we did not pass a RID, this is not a link - record.linkedTest2.should.equal('#5:1'); + record.linkedTest2.should.equal('#6:1'); }); });