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

chore(jq): Report an error when the compilation fail #274

Merged
merged 3 commits into from
Jul 31, 2024

Conversation

lquerel
Copy link
Contributor

@lquerel lquerel commented Jul 31, 2024

The interface of the method ParseCtx.compile in JAQ is error prone and it's a bit too easy to forget to check the errors. This PR fix this issue.

Closes #264

@lquerel lquerel requested a review from jsuereth as a code owner July 31, 2024 00:35
@@ -43,10 +43,22 @@ impl Filter {
filter: filter_expr.to_owned(),
error: "No parsed expression".to_owned(),
})?;
let filter = ctx.compile(parsed_expr);
if !ctx.errs.is_empty() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strangely, ParseCtx.compile(...) doesn't return a Result and forces us to check the errs field, as was done in the past... I opened an issue in the jaq project to improve that in the future.

@lquerel lquerel mentioned this pull request Jul 31, 2024
@lquerel lquerel merged commit b9fbbd7 into open-telemetry:main Jul 31, 2024
22 checks passed
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.

JQ errors are suppressed
3 participants