Skip to content

Commit 292de9e

Browse files
committed
allow object keys for AVLTree
1 parent ec97266 commit 292de9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/avltree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ _AVLTree.prototype.insert = function (key, value) {
270270
// Same key: no change in the tree structure
271271
if (currentNode.compareKeys(currentNode.key, key) === 0) {
272272
if (currentNode.unique) {
273-
var err = new Error("Can't insert key " + key + ", it violates the unique constraint");
273+
var err = new Error("Can't insert key " + JSON.stringify(key) + ", it violates the unique constraint");
274274
err.key = key;
275275
err.errorType = 'uniqueViolated';
276276
throw err;

0 commit comments

Comments
 (0)