25 lines
400 B
Go
25 lines
400 B
Go
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
|
|
}
|
|
}
|