Files
2026-08-27 09:27:14 +03:00

27 lines
473 B
Go

package mxladapter
import (
"context"
"errors"
"mxl-player/internal/source"
)
// ShouldRetry reports whether an MXL source error should start another attempt.
func ShouldRetry(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
}
}