Skip to content

Commit

Permalink
Add host to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Nov 6, 2022
1 parent 2df1f1b commit c0dce5c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ func (hosts *HostsController) sendMetric(host config.Host, client *Client) {
log.Error(errorContent)
hosts.resetDriver(host)
message := &SendMessage{
Message: errorContent,
Error: true,
Message: ErrorMessage{
Error: errorContent,
Host: host.Address,
},
Error: true,
}
client.Send <- message
}
Expand Down
5 changes: 5 additions & 0 deletions client/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ type SendMessage struct {
Message interface{}
}

type ErrorMessage struct {
Host string
Error string
}

type Message struct {
Host string
Name string
Expand Down

0 comments on commit c0dce5c

Please sign in to comment.