From 3f9f2dc37fd8a82b7f7c7688d9bc633c67e55738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=B3kai=20P=C3=A9ter?= Date: Tue, 7 Nov 2017 23:29:44 +0100 Subject: [PATCH] fix(github): Handle curl exceptions and bad status codes (#811) If any error occurs, a warning is logged and -1 is displayed as the number of notifications --- include/modules/github.hpp | 5 ++++- src/modules/github.cpp | 45 ++++++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/include/modules/github.hpp b/include/modules/github.hpp index 84db9107..845569d1 100644 --- a/include/modules/github.hpp +++ b/include/modules/github.hpp @@ -1,7 +1,7 @@ #pragma once -#include "settings.hpp" #include "modules/meta/timer_module.hpp" +#include "settings.hpp" #include "utils/http.hpp" POLYBAR_NS @@ -18,6 +18,9 @@ namespace modules { bool build(builder* builder, const string& tag) const; private: + void update_label(const int); + int get_number_of_notification(); + string request(); static constexpr auto TAG_LABEL = "