File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1616
1717namespace cb {
1818
19- // / The nlohmann exception code for incorrect types
20- const int nlohmannExceptionTypeCode = 302 ;
21-
2219/* *
2320 * Helper function for throwing nlohmann incorrect type exceptions. Useful
2421 * for when we want to throw exception of a consistent type.
2522 *
2623 * @param msg the error message to be printed
2724 */
2825[[noreturn]] inline void throwJsonTypeError (const std::string& msg) {
26+ const int nlohmannExceptionTypeCode = 302 ;
27+ #if NLOHMANN_JSON_VERSION_MAJOR == 3 && NLOHMANN_JSON_VERSION_MINOR < 10
28+ // / The nlohmann exception code for incorrect types
2929 throw nlohmann::detail::type_error::create (nlohmannExceptionTypeCode, msg);
30+ #else
31+ throw nlohmann::detail::type_error::create (
32+ nlohmannExceptionTypeCode, msg, nullptr );
33+ #endif
3034}
3135
3236/* *
You can’t perform that action at this time.
0 commit comments