diff options
author | tastytea | 2020-01-26 05:16:32 +0100 |
---|---|---|
committer | tastytea | 2020-01-26 05:19:58 +0100 |
commit | 151103a9a150a520edee280eb0962ca4058816c0 (patch) | |
tree | 898fa1c6d1e4950d24862d62c943c9fd48a8bf97 | |
parent | 25c75a6211b48e43b202d35c211fe515d99c4d95 (diff) | |
download | mastodonpp-151103a9a150a520edee280eb0962ca4058816c0.tar mastodonpp-151103a9a150a520edee280eb0962ca4058816c0.tar.gz mastodonpp-151103a9a150a520edee280eb0962ca4058816c0.zip |
Catch JSON exceptions in nlohmann-json example.
-rw-r--r-- | examples/example09_nlohmann_json.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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) |