warn on untracked error
This commit is contained in:
parent
780e899e90
commit
18b15674d9
1 changed files with 3 additions and 2 deletions
|
@ -111,11 +111,10 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a
|
||||||
|
|
||||||
err := ee.Wrap(e, 0)
|
err := ee.Wrap(e, 0)
|
||||||
errType := errOther
|
errType := errOther
|
||||||
//name := err.TypeName()
|
|
||||||
if strings.Contains(err.Error(), "i/o timeout") { // hit a read or write deadline
|
if strings.Contains(err.Error(), "i/o timeout") { // hit a read or write deadline
|
||||||
//log.Warnln("i/o timeout is not the same as context.DeadlineExceeded")
|
|
||||||
errType = errIOTimeout
|
errType = errIOTimeout
|
||||||
} else if errors.Is(e, syscall.ECONNRESET) {
|
} else if errors.Is(e, syscall.ECONNRESET) {
|
||||||
|
// Looks like we're getting this when direction == "download", but read_conn_reset when its "upload"
|
||||||
errType = errConnReset
|
errType = errConnReset
|
||||||
} else if errors.Is(e, context.DeadlineExceeded) {
|
} else if errors.Is(e, context.DeadlineExceeded) {
|
||||||
errType = errDeadlineExceeded
|
errType = errDeadlineExceeded
|
||||||
|
@ -136,6 +135,7 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a
|
||||||
} else if errors.Is(e, syscall.EPIPE) {
|
} else if errors.Is(e, syscall.EPIPE) {
|
||||||
errType = errEPipe
|
errType = errEPipe
|
||||||
} 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
|
||||||
|
// I believe this is the same as EPipe when direction == "download", but not for upload
|
||||||
errType = errWriteBrokenPipe
|
errType = errWriteBrokenPipe
|
||||||
//} else if errors.Is(e, reflector.ErrBlobTooBig) { # this creates a circular import
|
//} else if errors.Is(e, reflector.ErrBlobTooBig) { # this creates a circular import
|
||||||
// errType = errBlobTooBig
|
// errType = errBlobTooBig
|
||||||
|
@ -145,6 +145,7 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a
|
||||||
} else if _, ok := e.(*json.SyntaxError); ok {
|
} else if _, ok := e.(*json.SyntaxError); ok {
|
||||||
errType = errJSONSyntax
|
errType = errJSONSyntax
|
||||||
} else {
|
} else {
|
||||||
|
log.Warnf("error '%s' for direction '%s' is not being tracked", err.TypeName(), direction)
|
||||||
shouldLog = true
|
shouldLog = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue