From d5874fb041a87865e2b7980cf481d3094d119ef8 Mon Sep 17 00:00:00 2001 From: Zhandos Date: Mon, 2 Dec 2019 23:19:00 +0100 Subject: [PATCH] Add exception when connecting to graphite --- logster/outputs/graphite.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logster/outputs/graphite.py b/logster/outputs/graphite.py index f891b32..f523a54 100644 --- a/logster/outputs/graphite.py +++ b/logster/outputs/graphite.py @@ -39,7 +39,11 @@ def submit(self, metrics): else: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect((host[0], int(host[1]))) + try: + s.connect((host[0], int(host[1]))) + except Exception as e: + self.logger.warning("Can't connect to graphite host: %s", e) + return try: for metric in metrics: