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

Allow engine parser errors to be handled #22

Open
ViciousBadger opened this issue Sep 24, 2024 · 2 comments
Open

Allow engine parser errors to be handled #22

ViciousBadger opened this issue Sep 24, 2024 · 2 comments

Comments

@ViciousBadger
Copy link

ViciousBadger commented Sep 24, 2024

In engines/toml.rs (and similar in the other engines)

impl Engine for TOML {
    fn parse(content: &str) -> Pod {
        match toml::from_str::<Value>(content) {
            Ok(value) => value.into(),
            Err(_) => Pod::Null,
        }
    }
}

This makes it more difficult to troubleshoot issues with front matter parsing, since any internal error thrown by the parser is completely hidden. It would be nice if the Pod enum instead contained an error state containing whatever error type the internal parser uses. (Or something like that, I'm no expert)

@yuchanns
Copy link
Collaborator

SGTM.

This comment was marked as outdated.

@stale stale bot added the wontfix This will not be worked on label Nov 26, 2024
@yuchanns yuchanns removed the wontfix This will not be worked on label Nov 26, 2024
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

2 participants