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

Program should not crash when a json keyword is not found #58

Open
markstock opened this issue Oct 23, 2020 · 0 comments
Open

Program should not crash when a json keyword is not found #58

markstock opened this issue Oct 23, 2020 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@markstock
Copy link
Collaborator

When a json file uses old or incorrect syntax, the program crashes ungracefully. The culprit is lines in read_json functions like this:
m_thickness = j["thickness"];
One solution is to use an alternative assignment line that accepts a default value:
m_theta = j.value("rotation", 0.0);
But it would be even better to also inform the user that a property was not found and a default value was assigned.

@markstock markstock added bug Something isn't working enhancement New feature or request labels Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant