From 151103a9a150a520edee280eb0962ca4058816c0 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 26 Jan 2020 05:16:32 +0100 Subject: Catch JSON exceptions in nlohmann-json example. --- examples/example09_nlohmann_json.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/example09_nlohmann_json.cpp b/examples/example09_nlohmann_json.cpp index bf8db5c..ad94fac 100644 --- a/examples/example09_nlohmann_json.cpp +++ b/examples/example09_nlohmann_json.cpp @@ -106,7 +106,6 @@ int main(int argc, char *argv[]) { handle_error(answer); } - } catch (const masto::CURLException &e) { @@ -114,6 +113,10 @@ int main(int argc, char *argv[]) // There went probably something wrong with the initialization. cerr << e.what() << '\n'; } + catch (const nlohmann::detail::exception &e) + { + cerr << "JSON exception: " << e.what() << '\n'; + } } void handle_error(const masto::answer_type &answer) -- cgit v1.2.3-54-g00ecf