catch OperationaError when attempting to connect to mysql server
paulfantom committed
Aug 7, 2016 at 16:12 UTC
706badb083ef9ece71891e9ced0109bcc050919b
1 file changed
+4
python.d/mysql.chart.py
+4
@@ -351,6 +351,10 @@ class Service(SimpleService):
351
host=self.configuration['host'],
352
port=self.configuration['port'],
353
connect_timeout=self.update_every)
354
+ except MySQLdb.OperationalError as e:
355
+ self.error("Cannot establish connection to MySQL.")
356
+ self.debug(str(e))
357
+ raise RuntimeError
358
except Exception as e:
359
self.error("problem connecting to server:", e)
360
raise RuntimeError