add onValidationError and validationErrorFormatter option, better error handle for #1