define source retry decisions

This commit is contained in:
Dmitry Sergeev
2026-08-27 08:58:16 +03:00
parent 89a0522e20
commit 5d3b465e1e
2 changed files with 98 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package playback
import (
"context"
"errors"
"mxl-player/internal/source"
)
func shouldRetrySourceError(err error) bool {
if errors.Is(err, context.Canceled) {
return false
}
switch source.KindOf(err) {
case source.ErrorKindInvalidConfig:
return false
case source.ErrorKindTemporary,
source.ErrorKindUnavailable,
source.ErrorKindUnknown:
return true
default:
return true
}
}