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

Fix bug in catching Bifrost verification errors. #142

Merged
merged 2 commits into from
Aug 8, 2023
Merged
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: 2 additions & 2 deletions fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,12 @@ func (p *pool) fetchResource(ctx context.Context, from string, resource string,
received = wrapped.len
if err != nil {

var target *ErrInvalidResponse
var target = ErrInvalidResponse{}
if errors.As(err, &target) {
verificationError = err.Error()
goLogger.Errorw("failed to read response; verification error", "err", err.Error())
} else {
networkError = err.Error()
goLogger.Errorw("failed to read response; no verification error", "err", err.Error())
}

Expand All @@ -379,7 +380,6 @@ func (p *pool) fetchResource(ctx context.Context, from string, resource string,
saturnCallsFailureTotalMetric.WithLabelValues(resourceType, fmt.Sprintf("failed-response-read-%s", getCacheStatus(isCacheHit)), fmt.Sprintf("%d", code)).Add(1)
}

networkError = err.Error()
rm.NetworkError = true
return rm, err
}
Expand Down