Do not repair invalid download code error

This commit is contained in:
Ben Adrian Sarmiento
2024-07-01 03:37:04 +02:00
parent 99ca9d2602
commit b5fa74bd69
3 changed files with 17 additions and 6 deletions

View File

@@ -9,6 +9,13 @@ func IsBytesLimitReached(err error) bool {
return false
}
func IsInvalidDownloadCode(err error) bool {
if dlErr, ok := err.(*http.DownloadErrorResponse); ok && dlErr.Message == "invalid_download_code" {
return true
}
return false
}
func AreAllTokensExpired(err error) bool {
return err != nil && err.Error() == "all tokens are expired"
}