Bugfix: Don't throw unknown error if return code from mastodon-cpp is != 0

This commit is contained in:
tastytea 2018-10-08 00:36:54 +02:00
parent 603532a334
commit 2cf7cac099
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.6)
project (mastorss
VERSION 0.8.2
VERSION 0.8.3
LANGUAGES CXX
)

View File

@ -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 <https://schlomp.space/tastytea/mastorss/issues>.\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 <https://schlomp.space/tastytea/mastorss/issues>.\n";
return 1;
}
if (rit != entries.rend())
{ // Only sleep if this is not the last entry
sleep_for(seconds(config[profile]["interval"].asUInt64()));