Skip to content

Commit 8126b77

Browse files
committed
Fix error source for invalid or missing authentication token
1 parent a6690d2 commit 8126b77

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [4.5.8] - 2024-12-05
4+
5+
- Chore: Fix error source for invalid or missing authentication token
6+
37
## [4.5.7] - 2024-10-30
48

59
- Chore: Bump uplot to 1.6.31

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "grafana-zabbix",
3-
"version": "4.5.7",
3+
"version": "4.5.8",
44
"description": "Zabbix plugin for Grafana",
55
"homepage": "http://grafana-zabbix.org",
66
"bugs": {

pkg/zabbix/zabbix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ func (zabbix *Zabbix) Authenticate(ctx context.Context) error {
121121
if authType == settings.AuthTypeToken {
122122
token, exists := zabbix.dsInfo.DecryptedSecureJSONData["apiToken"]
123123
if !exists {
124-
return errors.New("cannot find Zabbix API token")
124+
return backend.DownstreamError(errors.New("cannot find Zabbix API token"))
125125
}
126126
err = zabbix.api.AuthenticateWithToken(ctx, token)
127127
if err != nil {
128128
zabbix.logger.Error("Zabbix authentication error", "error", err)
129-
return err
129+
return backend.DownstreamError(err)
130130
}
131131
zabbix.logger.Debug("Using API token for authentication")
132132
return nil

0 commit comments

Comments
 (0)