]> arthur.barton.de Git - netdata.git/commitdiff
catch OperationaError when attempting to connect to mysql server
authorpaulfantom <paulfantom@gmail.com>
Sun, 7 Aug 2016 14:12:09 +0000 (16:12 +0200)
committerpaulfantom <paulfantom@gmail.com>
Sun, 7 Aug 2016 14:12:09 +0000 (16:12 +0200)
python.d/mysql.chart.py

index d51aa2c0e06e76b06ddb7ba1fe95440b01bb5658..d84f322429b5234e923b96c1a3a0e47558e9f8a0 100644 (file)
@@ -351,6 +351,10 @@ class Service(SimpleService):
                                               host=self.configuration['host'],
                                               port=self.configuration['port'],
                                               connect_timeout=self.update_every)
+        except MySQLdb.OperationalError as e:
+            self.error("Cannot establish connection to MySQL.")
+            self.debug(str(e))
+            raise RuntimeError
         except Exception as e:
             self.error("problem connecting to server:", e)
             raise RuntimeError