Skip to content

only throws exceptions JSON_USE_EXCEPTION #174

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

Merged

Conversation

kobigurk
Copy link
Contributor

JSON_ASSERT now throws a runtime_error

JSON_ASSERT now throws a runtime_error
@cdunn2001
Copy link
Contributor

The only concern is that we could break something somewhere. Seems unlikely, but what do you think?

@kobigurk
Copy link
Contributor Author

I think it's the expected behavior when using JSON_USE_EXCEPTION (it was for me and colleagues, at least). It's also not the "expected behavior" case in which I would consider leaving the assert in production code.
But you have a point here that someone may (although unlikely) rely on it.
Although ugly, maybe we should add another define?

@cdunn2001
Copy link
Contributor

I'll go with your advice here. Probably nobody is using JSON_USE_EXCEPTION directly, right? I'm not too worried about converting an abort to an exception. I just want to be confident that you and your colleagues have considered all issues, since I don't have time.

@kobigurk
Copy link
Contributor Author

Well, we use it in production for about 1.5 years!
But I think I rushed a bit. I see that you've converted all but one calls to JSON_ASSERT to JSON_ASSERT_MESSAGE which throws exceptions, so it actually might not have a big effect at all (meaning, there was almost nothing to worry about in the first place).

cdunn2001 added a commit that referenced this pull request Feb 15, 2015
only throws exceptions JSON_USE_EXCEPTION
@cdunn2001 cdunn2001 merged commit 1522e4d into open-source-parsers:master Feb 15, 2015
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.

2 participants