From 620c60b1f58f78c48d34770c201029384f5047f5 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 4 Jun 2020 18:31:09 +0300 Subject: [PATCH] Add debug message in case of expired auth token --- pkg/datasource/zabbix.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/datasource/zabbix.go b/pkg/datasource/zabbix.go index d8032c4..0cb64e5 100644 --- a/pkg/datasource/zabbix.go +++ b/pkg/datasource/zabbix.go @@ -97,7 +97,11 @@ func (ds *ZabbixDatasourceInstance) ZabbixRequest(ctx context.Context, method st } result, err = ds.zabbixAPI.Request(ctx, method, params) - if err == zabbixapi.ErrNotAuthenticated || isNotAuthorized(err) { + notAuthorized := isNotAuthorized(err) + if err == zabbixapi.ErrNotAuthenticated || notAuthorized { + if notAuthorized { + ds.logger.Debug("Authentication token expired, performing re-login") + } err = ds.login(ctx) if err != nil { return nil, err