fix error

This commit is contained in:
Simon Martín 2018-03-28 13:31:31 +02:00
parent 616f3f3c07
commit 4301b63189

View File

@ -1,7 +1,7 @@
const ErrorHandler = require('./error_handler');
const pgErrorCodes = require('../postgresql/error_codes');
const { codeToCondition } = require('../postgresql/error_codes');
module.exports = function ErrorHandlerFactory () {
module.exports = function ErrorHandlerFactory (err) {
if (isTimeoutError(err)) {
return createTimeoutError();
} else {
@ -33,6 +33,6 @@ function createGenericError(err) {
err.detail,
err.hint,
err.http_status,
pgErrorCodes.codeToCondition[err.code] || err.name
codeToCondition[err.code] || err.name
);
}