/
githubmirror
/
json
Обзор
Документация
Войти
/
githubmirror
/
json
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.11.0
docs/examples/exception.cpp
20 строк
432 B
Niels Lohmann
Reorganize directories (#3462)
01 май 2022, 10:41
Не верифицирован
01 май 2022, 10:41
b21c345
Код
Авторство
О чём код?
#include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { try { // calling at() for a non-existing key json j = {{"foo", "bar"}}; json k = j.at("non-existing"); } catch (json::exception& e) { // output exception information std::cout << "message: " << e.what() << '\n' << "exception id: " << e.id << std::endl; } }