From 2619e311cfa753691d3950ec5439850f28ce9ea6 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 30 Aug 2018 01:13:22 +0200 Subject: [PATCH] Added check if toot really was sent --- CMakeLists.txt | 2 +- README.md | 8 +++++++- src/mastorss.cpp | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0026af..f949ce7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.6) project (mastorss - VERSION 0.7.5 + VERSION 0.7.6 LANGUAGES CXX ) diff --git a/README.md b/README.md index 6e73e9f..3133c17 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,13 @@ ${HOME}/.config/mastorss/config-example.json ## Error codes -Same as [mastodon-cpp](https://schlomp.space/tastytea/mastodon-cpp/src/branch/master/README.md#error-codes) +Same as +[mastodon-cpp](https://schlomp.space/tastytea/mastodon-cpp/src/branch/master/README.md#error-codes), +plus: + +| Code | Explanation | +| --------: |:----------------------------------------| +| 1 | Could not send post for unknown reasons | # Copyright diff --git a/src/mastorss.cpp b/src/mastorss.cpp index b1b9ea7..7230888 100644 --- a/src/mastorss.cpp +++ b/src/mastorss.cpp @@ -100,6 +100,12 @@ int main(int argc, char *argv[]) Mastodon::Easy masto(instance, access_token); answer = masto.send_post(*rit, ret); + if (answer.to_object().isNull()) + { + std::cerr << "Could not send post for unknown reasons.\n" + std::cerr << "Please file a bug at .\n": + return 1; + } if (ret != 0) {