CCALI / a2jdat

This repo hosts the distributable production version of the A2J Document Assembly Tool (DAT). The document assembly tool is an optional piece of software used for producing pdf documents at the end of A2J Author Guided Interviews.
https://www.a2jauthor.org
Other
3 stars 1 forks source link

joi.js library validation errors are not clear #53

Open mikemitchel opened 3 years ago

mikemitchel commented 3 years ago

When there are template errors from validation, it shows a list of errors that may or may not be directly related to the problem. In the below error case, the actual error was that the child "overflow" fails because [child "addendumLabel" fails because ["addendumLabel" is not allowed to be empty]]. Should see if one error is polluting or causing another, or if it's just reporting 'all the errors' because of a bad config or bad error condition defintion.

UnhandledPromiseRejectionWarning: ValidationError: child "patches" fails because ["patches" at position 35 fails because [child "type" fails because ["type" must be one of [text]], child "overflow" fails because [child "addendumLabel" fails because ["addendumLabel" is not allowed to be empty]], child "type" fails because ["type" must be one of [table-text]], child "type" fails because ["type" must be one of [checkmark]]]]