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

[RFC] Introduce a new macro function: JSON_INTERNAL_CATCH #1187

Merged
merged 1 commit into from
Aug 14, 2018

Conversation

simnalamburt
Copy link
Contributor

@simnalamburt simnalamburt commented Aug 4, 2018

Description

Patch devsisters@d0e60de4 introduces a new macro function; JSON_INTERNAL_CATCH.

With this patch, users will be able to separately handle exceptions raised by nlohmann/json itself and exceptions raised by the STL.

Devsisters Corp. is already using this patch internally. We're sending this PR for the users which might be able to meet similar cases.

The name "JSON_INTERNAL_CATCH" can be changed if you think it is inappropriate. Feedbacks are welcomed.

This patch is completely backward compatible.

Example

https://github.com/simnalamburt/snippets/blob/master/cpp/exception-with-stacktrace.cpp

Pull request checklist

  • Changes are described in the pull request, or an existing issue is referenced.
  • The test suite compiles and runs without error.
  • Code coverage is 100%. Test cases can be added by editing the test suite.
  • The source code is amalgamated; that is, after making changes to the sources in the include/nlohmann directory, run make amalgamate to create the single-header file single_include/nlohmann/json.hpp. The whole process is described here.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d0e60de on devsisters:json-internal-catch into 3ce4325 on nlohmann:develop.

@nlohmann nlohmann self-requested a review August 14, 2018 19:55
Copy link
Owner

@nlohmann nlohmann left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@nlohmann nlohmann self-assigned this Aug 14, 2018
@nlohmann nlohmann added this to the Release 3.1.3 milestone Aug 14, 2018
@nlohmann nlohmann merged commit 0e748f2 into nlohmann:develop Aug 14, 2018
@simnalamburt simnalamburt deleted the json-internal-catch branch August 24, 2018 12:48
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.

3 participants