zabbix: Improve error handling when login
@@ -40,6 +40,10 @@ class ZabbixCheck(AgentCheck):
response = self.request(zabbix_api, req_data)
token = response.get('result')
+ if token is None:
+ raise Exception(
+ 'Unable to login with params user={} api={}: {}'.format(zabbix_user, zabbix_api, response.get('error'))
+ )
return token
def logout(self, token, zabbix_api):
