fix circular import

This commit is contained in:
Alex Grintsvayg 2020-01-02 13:22:51 -05:00
parent 5465527faf
commit 1603b3bb22
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5

View file

@ -10,8 +10,6 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/lbryio/reflector.go/reflector"
ee "github.com/lbryio/lbry.go/v2/extras/errors" ee "github.com/lbryio/lbry.go/v2/extras/errors"
"github.com/lbryio/lbry.go/v2/extras/stop" "github.com/lbryio/lbry.go/v2/extras/stop"
@ -139,10 +137,10 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a
} else if strings.Contains(err.Error(), "write: broken pipe") { // tried to write to a pipe or socket that was closed by the peer } else if strings.Contains(err.Error(), "write: broken pipe") { // tried to write to a pipe or socket that was closed by the peer
log.Warnln("broken pipe is not the same as EPIPE") log.Warnln("broken pipe is not the same as EPIPE")
errType = errWriteBrokenPipe errType = errWriteBrokenPipe
} else if errors.Is(e, reflector.ErrBlobTooBig) { //} else if errors.Is(e, reflector.ErrBlobTooBig) { # this creates a circular import
errType = errBlobTooBig // errType = errBlobTooBig
} else if strings.Contains(err.Error(), "blob must be at most") { } else if strings.Contains(err.Error(), "blob must be at most") {
log.Warnln("blob must be at most X bytes is not the same as ErrBlobTooBig") //log.Warnln("blob must be at most X bytes is not the same as ErrBlobTooBig")
errType = errBlobTooBig errType = errBlobTooBig
} else if _, ok := e.(*json.SyntaxError); ok { } else if _, ok := e.(*json.SyntaxError); ok {
errType = errJSONSyntax errType = errJSONSyntax