From 43570ec97585a5da92ebbc7160cec6668f86bd84 Mon Sep 17 00:00:00 2001 From: ameanasad Date: Mon, 2 Oct 2023 16:57:34 -0400 Subject: [PATCH] improve error classification --- fetcher.go | 4 +++- log.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fetcher.go b/fetcher.go index b7b3c80..4a4b371 100644 --- a/fetcher.go +++ b/fetcher.go @@ -87,6 +87,7 @@ func (p *pool) fetchResource(ctx context.Context, from *Node, resource string, m isCacheHit := false networkError := "" verificationError := "" + otherError := "" isBlockRequest := false if mime == "application/vnd.ipld.raw" { @@ -174,6 +175,7 @@ func (p *pool) fetchResource(ctx context.Context, from *Node, resource string, m NodeIpAddress: from.URL, IfNetworkError: networkError, VerificationError: verificationError, + OtherError: otherError, } } } @@ -315,7 +317,7 @@ func (p *pool) fetchResource(ctx context.Context, from *Node, resource string, m verificationError = err.Error() goLogger.Errorw("failed to read response; verification error", "err", err.Error()) } else { - networkError = err.Error() + otherError = err.Error() goLogger.Errorw("failed to read response; no verification error", "err", err.Error()) } diff --git a/log.go b/log.go index ec978f1..7248558 100644 --- a/log.go +++ b/log.go @@ -105,4 +105,5 @@ type log struct { IfNetworkError string `json:"ifNetworkError"` NodeIpAddress string `json:"nodeIpAddress"` VerificationError string `json:"verificationError"` + OtherError string `json:"otherError"` }