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

Throw a custom JsonPathException instead of generic RuntimeException #124

Merged
merged 2 commits into from
Jul 11, 2021

Conversation

crocodele
Copy link
Collaborator

@crocodele crocodele commented Jul 10, 2021

This PR introduces a JsonPathException that is thrown on all occasions where we previously threw a RuntimeException. The logic is placed in exceptions.c, which allows easy re-use across the project using a throw_jsonpath_exception() function.

The arginfo generation now makes use of the recent (?) addition of @generate-class-entries. This slightly reduces the amount of boilerplate code in jsonpath.c. Instead we get the code auto-generated into the arginfo files based on the class definitions in the stub. Yay!

@github-actions github-actions bot added the feature New feature label Jul 10, 2021
@crocodele crocodele requested a review from mk6i July 10, 2021 20:28
Copy link
Collaborator

@mk6i mk6i left a comment

Choose a reason for hiding this comment

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

LGTM. One small thing, would you please run clang-format?

clang-format -i src/jsonpath/*.{c,h} *.{c,h}

@crocodele crocodele requested a review from mk6i July 11, 2021 17:25
@mk6i mk6i merged commit 7866c5b into main Jul 11, 2021
@mk6i mk6i deleted the feature/JsonPathException branch July 12, 2021 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants