Show error notification when new streams notifications failed

This commit is contained in:
Stypox 2021-12-31 20:04:56 +01:00
parent c70713a925
commit daaf28ddd4
2 changed files with 8 additions and 1 deletions

View file

@ -17,6 +17,9 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.core.Single
import org.schabi.newpipe.App
import org.schabi.newpipe.R
import org.schabi.newpipe.error.ErrorInfo
import org.schabi.newpipe.error.ErrorUtil
import org.schabi.newpipe.error.UserAction
import org.schabi.newpipe.local.feed.service.FeedLoadManager
import org.schabi.newpipe.local.feed.service.FeedLoadService
import java.util.concurrent.TimeUnit
@ -59,7 +62,10 @@ class NotificationWorker(
}
.doOnError { throwable ->
Log.e(TAG, "Error while displaying streams notifications", throwable)
// TODO show error notification
ErrorUtil.createNotification(
applicationContext,
ErrorInfo(throwable, UserAction.NEW_STREAMS_NOTIFICATIONS, "main worker")
)
}
.onErrorReturnItem(Result.failure())
} else {