Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Puczynski committed Feb 25, 2019
1 parent 2c2923e commit 7469b1a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,26 @@ export default function validateFormData(
formerMetaSchema = additionalMetaSchemas;
}

let validationErrors = null;
let validationError = null;
try {
ajv.validate(schema, formData);
} catch (err) {
validationErrors = err;
validationError = err;
}

let errors = transformAjvErrors(ajv.errors);
// Clear errors to prevent persistent errors, see #1104

if (validationErrors && validationErrors.message) {
ajv.errors = null;
if (validationError && validationError.message) {
errors = [
...errors,
{
stack: validationErrors.message,
stack: validationError.message,
},
];
}

// Clear errors to prevent persistent errors, see #1104
ajv.errors = null;

if (typeof transformErrors === "function") {
errors = transformErrors(errors);
}
Expand Down

0 comments on commit 7469b1a

Please sign in to comment.