diff options
-rw-r--r-- | Gopkg.lock | 34 | ||||
-rw-r--r-- | pkg/app/app.go | 2 | ||||
-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 |
7 files changed, 32 insertions, 30 deletions
diff --git a/Gopkg.lock b/Gopkg.lock index 7921b97fc..f17280449 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -173,14 +173,6 @@ [[projects]] branch = "master" - digest = "1:d457d39e88f678ed14ac29517c3d74927a48dbc6a9f073fa241cf364a68cbe5c" - name = "github.com/heroku/rollrus" - packages = ["."] - pruneopts = "NUT" - revision = "fc0cef2ff331aebb24cd4e9ded7e20650f3d7006" - -[[projects]] - branch = "master" digest = "1:62fe3a7ea2050ecbd753a71889026f83d73329337ada66325cbafd5dea5f713d" name = "github.com/jbenet/go-context" packages = ["io"] @@ -213,6 +205,22 @@ [[projects]] branch = "master" + digest = "1:7429d1589cc1454e9e97ba48cb7c5025a085b32eae4d3163c517e3e5d6c7a7a0" + name = "github.com/jesseduffield/roll" + packages = ["."] + pruneopts = "NUT" + revision = "695be2e62b007ecef6644383f0ee9504c1f5cbb9" + +[[projects]] + branch = "master" + digest = "1:ec8982ff49a9ebdd7d7dfe320258ad19a07baafb5eeba7f41b31ee2072d1bba9" + name = "github.com/jesseduffield/rollrus" + packages = ["."] + pruneopts = "NUT" + revision = "7086c0b1b1bd21ef1f502e914ff2505a68c7d638" + +[[projects]] + branch = "master" digest = "1:3ab130f65766f5b7cc944d557df31c6a007ec017151705ec1e1b8719f2689021" name = "github.com/jesseduffield/termbox-go" packages = ["."] @@ -446,14 +454,6 @@ version = "v1.2.2" [[projects]] - branch = "master" - digest = "1:e42372d3f4921ec35df07f9b23239631e9d28580f7c1edcca212bc6daddc68fe" - name = "github.com/stvp/roll" - packages = ["."] - pruneopts = "NUT" - revision = "3627a5cbeaeaa68023abd02bb8687925265f2f63" - -[[projects]] digest = "1:cd5ffc5bda4e0296ab3e4de90dbb415259c78e45e7fab13694b14cde8ab74541" name = "github.com/tcnksm/go-gitconfig" packages = ["."] @@ -630,10 +630,10 @@ "github.com/fatih/color", "github.com/go-errors/errors", "github.com/golang-collections/collections/stack", - "github.com/heroku/rollrus", "github.com/jesseduffield/go-getter", "github.com/jesseduffield/gocui", "github.com/jesseduffield/pty", + "github.com/jesseduffield/rollrus", "github.com/kardianos/osext", "github.com/mgutz/str", "github.com/nicksnyder/go-i18n/v2/i18n", diff --git a/pkg/app/app.go b/pkg/app/app.go index fc75a6608..85caa446d 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -9,12 +9,12 @@ import ( "path/filepath" "strings" - "github.com/heroku/rollrus" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/gui" "github.com/jesseduffield/lazygit/pkg/i18n" "github.com/jesseduffield/lazygit/pkg/updates" + "github.com/jesseduffield/rollrus" "github.com/shibukawa/configdir" "github.com/sirupsen/logrus" ) 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) { |