Various manual ESLint fixes

master
Sven Slootweg 3 years ago
parent 6a026cd4c1
commit 6fbac562af

@ -27,7 +27,7 @@ module.exports = {
throw new Error("Encountered unknown error format");
}
let [_, query, table, constraint] = messageMatch;
let [_, query, _table, _constraint] = messageMatch;
let columns = getColumns(query);

@ -20,7 +20,7 @@ module.exports = {
);
},
convert: function convertError(error) {
let [_, query, column] = messageRegex.exec(error.message);
let [_, query, _column] = messageRegex.exec(error.message);
return new NotNullConstraintViolationError(`Missing required value for column '${error.column}' in table '${error.table}'`, {
originalError: error,

@ -4,7 +4,6 @@ const { create } = require("error-chain");
const pgErrorCodes = require("pg-error-codes");
const DatabaseError = require("../database-error.js");
const getTable = require("../get-table");
let UndefinedColumnError = create("UndefinedColumnError", { inheritsFrom: DatabaseError });

@ -5,7 +5,7 @@ let updateRegex = /^update "[^"]+" set (.+) where/;
let updateColumnRegex = /^"([^"]+)"/;
module.exports = function getColumns(query) {
let match, columns;
let match;
if (match = insertRegex.exec(query)) {
return match[1].split(",").map((columnName) => {

@ -1,7 +1,5 @@
'use strict';
const Promise = require("bluebird");
module.exports = {
up: function createCheckConstraintViolationTable(knex, errorHandler) {
return knex.schema.createTable("check_constraint_violation", (table) => {

@ -12,7 +12,7 @@ let tables = [
require("./not-null-constraint-violation")
];
let noop = function noop(err) {
let noop = function noop(_err) {
// Do nothing.
};

Loading…
Cancel
Save