Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

improve error classification #165

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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,
}
}
}
Expand Down Expand Up @@ -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())
}

Expand Down
1 change: 1 addition & 0 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ type log struct {
IfNetworkError string `json:"ifNetworkError"`
NodeIpAddress string `json:"nodeIpAddress"`
VerificationError string `json:"verificationError"`
OtherError string `json:"otherError"`
}