mirror of
https://github.com/juanfont/headscale.git
synced 2026-09-10 02:31:59 +09:00
hi: compare the stream error with errors.Is
This commit is contained in:
committed by
Kristoffer Dalby
parent
0a4d56494f
commit
635bda9139
+2
-1
@@ -6,6 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -258,7 +259,7 @@ func (sc *StatsCollector) collectStatsForContainer(ctx context.Context, containe
|
||||
err := decoder.Decode(&stats)
|
||||
if err != nil {
|
||||
// [io.EOF] is expected when container stops or stream ends
|
||||
if err.Error() != "EOF" && verbose {
|
||||
if !errors.Is(err, io.EOF) && verbose {
|
||||
log.Printf("Failed to decode stats for container %s: %v", containerID[:12], err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user