TradeTrust / document-creator-website

https://creator.tradetrust.io
Apache License 2.0
1 stars 15 forks source link

fix: ajv error message #251

Closed simboonlong closed 2 years ago

simboonlong commented 2 years ago

Summary

Construct ajv errors with more hints.

Changes

There are currently 2 kinds of error handling going on with the dropzones:

  1. schema validate via ajv
  2. custom file detect + custom error messages

If i'm understanding correctly, the above 2 became coupled at here.

Moving forward, FormErrorBanner / formErrors will be used for ajv related errors, while ErrorMessage / fileErrors will be for file custom errors.

FYI: Looks like there is another option, with the help of additional library to handle errors at schema side instead 👀.

Before: b4

After: after

Issues