sails-disk
Advanced tools
Comparing version 1.0.0-2 to 1.0.0-3
22
index.js
@@ -239,3 +239,5 @@ /** | ||
if (err.errorType === 'uniqueViolated') { | ||
err.code = 'E_UNIQUE'; | ||
err.footprint = { | ||
identity: 'notUnique' | ||
}; | ||
// If we can infer which attribute this refers to, add a `keys` array to the error. | ||
@@ -245,5 +247,5 @@ // First, see if only one value in the new record matches the value that triggered the uniqueness violation. | ||
// If so, find the key (i.e. column name) that this value was assigned to, add set that in the `keys` array. | ||
err.keys = [_.findKey(query.newRecord, function(val) {return val === err.key;})]; | ||
err.footprint.keys = [_.findKey(query.newRecord, function(val) {return val === err.key;})]; | ||
} else { | ||
err.keys = []; | ||
err.footprint.keys = []; | ||
} | ||
@@ -309,4 +311,6 @@ } | ||
if (err.errorType === 'uniqueViolated') { | ||
err.code = 'E_UNIQUE'; | ||
err.keys = []; | ||
err.footprint = { | ||
identity: 'notUnique', | ||
keys: [] | ||
}; | ||
} | ||
@@ -416,3 +420,5 @@ return cb(err); | ||
if (err.errorType === 'uniqueViolated') { | ||
err.code = 'E_UNIQUE'; | ||
err.footprint = { | ||
identity: 'notUnique' | ||
}; | ||
} | ||
@@ -423,5 +429,5 @@ // If we can infer which attribute this refers to, add a `keys` array to the error. | ||
// If so, find the key (i.e. column name) that this value was assigned to, add set that in the `keys` array. | ||
err.keys = [_.findKey(query.valuesToSet, function(val) {return val === err.key;})]; | ||
err.footprint.keys = [_.findKey(query.valuesToSet, function(val) {return val === err.key;})]; | ||
} else { | ||
err.keys = []; | ||
err.footprint.keys = []; | ||
} | ||
@@ -428,0 +434,0 @@ return cb(err); |
{ | ||
"name": "sails-disk", | ||
"version": "1.0.0-2", | ||
"version": "1.0.0-3", | ||
"description": "Persistent local-disk adapter for Sails.js / Waterline", | ||
@@ -38,6 +38,6 @@ "main": "index.js", | ||
"mocha": "3.0.2", | ||
"waterline-adapter-tests": "^0.12.1" | ||
"waterline-adapter-tests": "^1.0.0-2" | ||
}, | ||
"waterlineAdapter": { | ||
"waterlineVersion": "^0.12.0", | ||
"waterlineVersion": "^0.13.0", | ||
"interfaces": [ | ||
@@ -44,0 +44,0 @@ "semantic", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43505
671