Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate: improved utf8 error mesages #1256

Merged
merged 4 commits into from
Aug 27, 2023
Merged

Conversation

jqnatividad
Copy link
Collaborator

  • add header utf8-error specific error messages in RFC-4180 Validation Mode
  • add utf8-error specific error messages in JSON Schema Validation Mode
  • add more proactive guidance to error messages to transcode to utf8 when not returning error messages in JSON format
  • also removed thousands crate and replaced with indicatif::HumanCount
  • expanded implementation comments

warning: redundant else block
   --> src/cmd/validate.rs:278:28
    |
278 |                       } else {
    |  ____________________________^
279 | |                         // it's not a UTF-8 error, so we report generic validation error
280 | |                         let validation_error = json!({
281 | |                             "errors": [{
...   |
296 | |                         return fail!(json_error);
297 | |                     }
    | |_____________________^
    |
    = help: remove the `else` block and move the contents out
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
    = note: `-W clippy::redundant-else` implied by `-W clippy::pedantic`
also add more specific guidance on transcoding to UTF-8 first using `iconv` or `recode`.
…or messages/exit codes

when validating with a JSON Schema
@jqnatividad jqnatividad merged commit 5fa61d4 into master Aug 27, 2023
9 checks passed
@jqnatividad jqnatividad deleted the validate-improvements branch September 10, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant