From 18b15674d910bd424a58d2d1c46e7d1e3d17b8da Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 3 Jan 2020 12:28:01 -0500 Subject: [PATCH] warn on untracked error --- internal/metrics/metrics.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index 1fbf94a..aeee05f 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -111,11 +111,10 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a err := ee.Wrap(e, 0) errType := errOther - //name := err.TypeName() 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 } 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 } else if errors.Is(e, context.DeadlineExceeded) { errType = errDeadlineExceeded @@ -136,6 +135,7 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a } else if errors.Is(e, syscall.EPIPE) { 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 + // I believe this is the same as EPipe when direction == "download", but not for upload errType = errWriteBrokenPipe //} else if errors.Is(e, reflector.ErrBlobTooBig) { # this creates a circular import // errType = errBlobTooBig @@ -145,6 +145,7 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a } else if _, ok := e.(*json.SyntaxError); ok { errType = errJSONSyntax } else { + log.Warnf("error '%s' for direction '%s' is not being tracked", err.TypeName(), direction) shouldLog = true }