diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/jesseduffield/roll/LICENSE (renamed from vendor/github.com/stvp/roll/LICENSE) | 0 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/roll/client.go (renamed from vendor/github.com/stvp/roll/client.go) | 6 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/roll/stack.go (renamed from vendor/github.com/stvp/roll/stack.go) | 0 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/rollrus/LICENSE (renamed from vendor/github.com/heroku/rollrus/LICENSE) | 0 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/rollrus/rollrus.go (renamed from vendor/github.com/heroku/rollrus/rollrus.go) | 20 |
5 files changed, 14 insertions, 12 deletions
diff --git a/vendor/github.com/stvp/roll/LICENSE b/vendor/github.com/jesseduffield/roll/LICENSE index 1235e06b5..1235e06b5 100644 --- a/vendor/github.com/stvp/roll/LICENSE +++ b/vendor/github.com/jesseduffield/roll/LICENSE diff --git a/vendor/github.com/stvp/roll/client.go b/vendor/github.com/jesseduffield/roll/client.go index 687343f2a..284a3a883 100644 --- a/vendor/github.com/stvp/roll/client.go +++ b/vendor/github.com/jesseduffield/roll/client.go @@ -203,7 +203,8 @@ func (c *rollbarClient) send(item map[string]interface{}) (uuid string, err erro resp, err := http.Post(Endpoint, "application/json", bytes.NewReader(jsonBody)) if err != nil { - return "", err + // If something goes wrong it really does not matter + return "", nil } defer func() { io.Copy(ioutil.Discard, resp.Body) @@ -211,7 +212,8 @@ func (c *rollbarClient) send(item map[string]interface{}) (uuid string, err erro }() if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("Rollbar returned %s", resp.Status) + // If something goes wrong it really does not matter + return "", nil } // Extract UUID from JSON response diff --git a/vendor/github.com/stvp/roll/stack.go b/vendor/github.com/jesseduffield/roll/stack.go index c50425491..c50425491 100644 --- a/vendor/github.com/stvp/roll/stack.go +++ b/vendor/github.com/jesseduffield/roll/stack.go diff --git a/vendor/github.com/heroku/rollrus/LICENSE b/vendor/github.com/jesseduffield/rollrus/LICENSE index 8d4a5174d..8d4a5174d 100644 --- a/vendor/github.com/heroku/rollrus/LICENSE +++ b/vendor/github.com/jesseduffield/rollrus/LICENSE diff --git a/vendor/github.com/heroku/rollrus/rollrus.go b/vendor/github.com/jesseduffield/rollrus/rollrus.go index 50dd225da..2d32b4e56 100644 --- a/vendor/github.com/heroku/rollrus/rollrus.go +++ b/vendor/github.com/jesseduffield/rollrus/rollrus.go @@ -1,4 +1,4 @@ -// Package rollrus combines github.com/stvp/roll with github.com/sirupsen/logrus +// Package rollrus combines github.com/jesseduffield/roll with github.com/sirupsen/logrus // via logrus.Hook mechanism, so that whenever logrus' logger.Error/f(), // logger.Fatal/f() or logger.Panic/f() are used the messages are // intercepted and sent to rollbar. @@ -22,9 +22,9 @@ import ( "os" "time" + "github.com/jesseduffield/roll" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "github.com/stvp/roll" ) var defaultTriggerLevels = []logrus.Level{ @@ -37,7 +37,7 @@ var defaultTriggerLevels = []logrus.Level{ type Hook struct { roll.Client triggers []logrus.Level - ignoredErrors map[error]struct{} + ignoredErrors []error ignoreErrorFunc func(error) bool ignoreFunc func(error, map[string]string) bool @@ -78,12 +78,10 @@ func WithMinLevel(level logrus.Level) OptionFunc { } // WithIgnoredErrors is an OptionFunc that whitelists certain errors to prevent -// them from firing. +// them from firing. See https://golang.org/ref/spec#Comparison_operators func WithIgnoredErrors(errors ...error) OptionFunc { return func(h *Hook) { - for _, e := range errors { - h.ignoredErrors[e] = struct{}{} - } + h.ignoredErrors = append(h.ignoredErrors, errors...) } } @@ -120,7 +118,7 @@ func NewHookForLevels(token string, env string, levels []logrus.Level) *Hook { return &Hook{ Client: roll.New(token, env), triggers: levels, - ignoredErrors: make(map[error]struct{}), + ignoredErrors: make([]error, 0), ignoreErrorFunc: func(error) bool { return false }, ignoreFunc: func(error, map[string]string) bool { return false }, } @@ -179,8 +177,10 @@ func (r *Hook) Levels() []logrus.Level { // returned by Levels(). func (r *Hook) Fire(entry *logrus.Entry) error { trace, cause := extractError(entry) - if _, ok := r.ignoredErrors[cause]; ok { - return nil + for _, ie := range r.ignoredErrors { + if ie == cause { + return nil + } } if r.ignoreErrorFunc(cause) { |