ensuring vars

This commit is contained in:
Simon Martín 2017-11-28 16:02:12 +01:00
parent 100a2986b9
commit a007fce913

View File

@ -163,7 +163,7 @@ function errorMessageWithContext(err) {
}
function logErrors(errors, statusCode, res) {
const errorsCopy = errors.slice(0);
let errorsCopy = errors.slice(0);
if(!errorsCopy || !errorsCopy.length) {
return;
@ -171,7 +171,7 @@ function logErrors(errors, statusCode, res) {
const mainError = errorsCopy.shift();
const errorsLog = {
let errorsLog = {
statusCode: statusCode || 200,
message: mainError.message,
name: mainError.name,