From 2cf7cac099d49c484f9fbd0e9b1a72396dcb36f0 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 8 Oct 2018 00:36:54 +0200 Subject: [PATCH] Bugfix: Don't throw unknown error if return code from mastodon-cpp is != 0 --- CMakeLists.txt | 2 +- src/mastorss.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab93bcb..c184309 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.6) project (mastorss - VERSION 0.8.2 + VERSION 0.8.3 LANGUAGES CXX ) diff --git a/src/mastorss.cpp b/src/mastorss.cpp index 70687c0..7b4fc47 100644 --- a/src/mastorss.cpp +++ b/src/mastorss.cpp @@ -102,12 +102,6 @@ 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) { @@ -116,6 +110,13 @@ int main(int argc, char *argv[]) return 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 (rit != entries.rend()) { // Only sleep if this is not the last entry sleep_for(seconds(config[profile]["interval"].asUInt64()));