mirror of
https://codeberg.org/scip/io-exporter.git
synced 2025-12-17 12:31:03 +01:00
fix #5: nobody understands context deadline exceeded, use timeout
This commit is contained in:
10
cmd/root.go
10
cmd/root.go
@@ -54,11 +54,17 @@ func Run() {
|
||||
}
|
||||
|
||||
func report(err error, fd *os.File) bool {
|
||||
slog.Debug("failed to check io", "error", err)
|
||||
failure := err.Error()
|
||||
if err.Error() == "context deadline exceeded" {
|
||||
failure = "operation timed out"
|
||||
}
|
||||
|
||||
slog.Debug("failed to check io", "error", failure)
|
||||
|
||||
if fd != nil {
|
||||
if err := fd.Close(); err != nil {
|
||||
slog.Debug("failed to close filehandle", "error", err)
|
||||
|
||||
slog.Debug("failed to close filehandle", "error", failure)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user