Skip to content

Commit

Permalink
Add cluster context to handled errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Apr 1, 2019
1 parent 0eed527 commit 28135c0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cluster/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ import (
"strings"
"time"

"github.com/banzaicloud/pipeline/auth"
"github.com/banzaicloud/pipeline/config"
pipelineContext "github.com/banzaicloud/pipeline/internal/platform/context"
"github.com/banzaicloud/pipeline/model"
"github.com/goph/emperror"
"github.com/patrickmn/go-cache"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"go.uber.org/cadence/client"

"github.com/banzaicloud/pipeline/auth"
"github.com/banzaicloud/pipeline/config"
pipelineContext "github.com/banzaicloud/pipeline/internal/platform/context"
"github.com/banzaicloud/pipeline/model"
)

type clusterRepository interface {
Expand Down Expand Up @@ -111,6 +112,13 @@ func (c clusterErrorHandler) Handle(err error) {
}
_ = c.cluster.SetStatus(c.status, statusMessage)
}

err = emperror.With(
err,
"clusterId", c.cluster.GetID(),
"clusterName", c.cluster.GetName(),
)

c.handler.Handle(err)
}

Expand Down

0 comments on commit 28135c0

Please sign in to comment.