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

Commit

Permalink
improve error classification
Browse files Browse the repository at this point in the history
  • Loading branch information
AmeanAsad committed Oct 2, 2023
1 parent 8804f45 commit 43570ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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"`
}

0 comments on commit 43570ec

Please sign in to comment.