Skip to content

Commit

Permalink
Fixes PermissionDenied errors (#33)
Browse files Browse the repository at this point in the history
* Fixes PermissionDenied errors

Relates to #32

* Get rid of logs
  • Loading branch information
awlx authored Jun 30, 2021
1 parent 41bf0b9 commit 8ec4a5e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
"google.golang.org/grpc"
"google.golang.org/grpc/status"

"github.com/danopstech/starlink_exporter/pkg/spacex.com/api/device"
)
Expand Down Expand Up @@ -287,8 +288,11 @@ func (e *Exporter) collectDishContext(ch chan<- prometheus.Metric) bool {
defer cancel()
resp, err := e.Client.Handle(ctx, req)
if err != nil {
log.Errorf("failed to collect context from dish: %s", err.Error())
return false
st, ok := status.FromError(err)
if ok && st.Code() != 7 {
log.Errorf("failed to collect context from dish: %s", err.Error())
return false
}
}

dishC := resp.GetDishGetContext()
Expand Down

0 comments on commit 8ec4a5e

Please sign in to comment.