Skip to content

Commit 8c6880c

Browse files
Kern--turan18
authored andcommitted
Retain original cache.Get error in span manager
Before this change, the span manager would replace the error received from `m.cache.Get` with a generic `ErrSpanNotAvailable`. The way we use the cache is really just as an abstraction of disk storage for span data so we don't generally expect `m.cache.Get` to throw an error. If it does, we should keep that context. Signed-off-by: Kern Walster <[email protected]>
1 parent f4a0749 commit 8c6880c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: fs/span-manager/span_manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ func (m *SpanManager) addSpanToCache(spanID compression.SpanID, contents []byte,
396396
func (m *SpanManager) getSpanFromCache(spanID compression.SpanID, offset, size compression.Offset) (io.Reader, error) {
397397
r, err := m.cache.Get(fmt.Sprintf("%d", spanID))
398398
if err != nil {
399-
return nil, ErrSpanNotAvailable
399+
return nil, fmt.Errorf("%w: %w", ErrSpanNotAvailable, err)
400400
}
401401
runtime.SetFinalizer(r, func(r cache.Reader) {
402402
r.Close()

0 commit comments

Comments
 (0)