korzio/djv

Improve error reporting

Closed this issue ยท 4 comments

Hey. Firstly, great job. I'm working on an application analytics abstraction framework project for some of the UK's largest retailers dealing with very heavy traffic to their sites. I'm in need of a schema validation framework as part of it and application bundle size really matters. Various schema validators I've assessed add 100kb+ to the overall, optimised (usually Webpack based) application size (such as ajv and joi), which just isn't feasible. Whereas yours adds only 11kb optimised, which is fantastic ๐Ÿ‘

The only issue I've run into is with error output, or lack of. Unless I'm missing something, it's difficult to really take advantage of validation and error reporting with errors as plain as required: data. Is there currently a way to have more informative and machine dissectible errors? I.e. exactly what fields are missing? Also, the option to halt on first error or error on all?

If not, I'm more than happy to get stuck in and contribute (rather than hound you for features). Plus, through my choice some rather large companies may have a dependency on this library so it's in my own interest to help with its longevity ๐Ÿ˜›

Thanks @damon-kreft , there is already a ticket related to formatting an error - #16 , and this is one of the next priorities

Ah apologies, I overlooked that. Thanks @korzio

Hey @damon-kreft I've just created a mr regarding this feature. Please take a look into a error handler format if you are still interested - now it is possible to generate any type of error, also with multi errors mode. This feature will be included in 1.1.0 release