generic-sequelize-errors
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,3 +8,3 @@ var errors = require('generic-errors'); | ||
.keys(error.fields) | ||
.reduce(function (acc, key, index, arr) { | ||
.reduce(function (acc, key) { | ||
acc[key] = error.get(key).map((fieldError) => fieldError.message); | ||
@@ -17,3 +17,3 @@ return acc; | ||
} | ||
if (error instanceof Sequelize.BaseError) { | ||
if (error instanceof Sequelize.Error) { | ||
return new errors.BaseError({ message: error.message }); | ||
@@ -20,0 +20,0 @@ } |
{ | ||
"name": "generic-sequelize-errors", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Map Sequelize errors to errors provided by generic-errors", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -71,3 +71,3 @@ var test = require('tape'); | ||
var testSequelize = { | ||
BaseError, | ||
Error: BaseError, // For some reason Sequelize has chosen not to document this name change | ||
ValidationError, | ||
@@ -94,3 +94,3 @@ DatabaseError, | ||
var testError = new BaseError('some message'); | ||
var testError = new testSequelize.Error('some message'); | ||
@@ -121,3 +121,3 @@ t.equal(typeof genericSequeliseError, 'function', 'module is a function'); | ||
var testError = new testSequelize.BaseError('some message'); | ||
var testError = new testSequelize.Error('some message'); | ||
var expectedError = new errors.BaseError({ message: 'some message' }); | ||
@@ -124,0 +124,0 @@ var expectedType = errors.BaseError; |
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
7046