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

Feature Request: Show parse error messages #97

Open
RigoLigoRLC opened this issue Nov 13, 2024 · 0 comments
Open

Feature Request: Show parse error messages #97

RigoLigoRLC opened this issue Nov 13, 2024 · 0 comments

Comments

@RigoLigoRLC
Copy link

Parse error of YAML files may be inevident. I'm using this library for the first time and it threw an error stating

error: proc macro panicked
  --> src/main.rs:11:1
   |
11 | rust_i18n::i18n!("locales", fallback = "en");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: Parse file `P:\prj\rust\[project]\locales\app.yml` failed

without any reasons. I had to pull this library locally and patch crates/support/src/lib.rs:L108-L109

        let trs = parse_file(&content, ext, locale)
            .unwrap_or_else(|e| panic!("Parse file `{}` failed, reason: {}", entry.display(), e));

to see whatever is wrong (RustRover didn't give me error messages on my YAML file, I can't be sure what's wrong):

error: proc macro panicked
  --> src/main.rs:11:1
   |
11 | rust_i18n::i18n!("locales", fallback = "en");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: Parse file `P:\prj\rust\mcentitycleaner\locales\app.yml` failed, reason: Invalid YAML format, did not find expected key at line 12 column 11, while parsing a block mapping at line 12 column 3
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

No branches or pull requests

1 participant