Skip to content

Commit ccbc3af

Browse files
committed
Show error notification when new streams notifications failed
1 parent cd95ec4 commit ccbc3af

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

app/src/main/java/org/schabi/newpipe/error/UserAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public enum UserAction {
2626
DOWNLOAD_OPEN_DIALOG("download open dialog"),
2727
DOWNLOAD_POSTPROCESSING("download post-processing"),
2828
DOWNLOAD_FAILED("download failed"),
29+
NEW_STREAMS_NOTIFICATIONS("new streams notifications"),
2930
PREFERENCES_MIGRATION("migration of preferences"),
3031
SHARE_TO_NEWPIPE("share to newpipe"),
3132
CHECK_FOR_NEW_APP_VERSION("check for new app version");

app/src/main/java/org/schabi/newpipe/local/feed/notifications/NotificationWorker.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
1717
import io.reactivex.rxjava3.core.Single
1818
import org.schabi.newpipe.App
1919
import org.schabi.newpipe.R
20+
import org.schabi.newpipe.error.ErrorInfo
21+
import org.schabi.newpipe.error.ErrorUtil
22+
import org.schabi.newpipe.error.UserAction
2023
import org.schabi.newpipe.local.feed.service.FeedLoadManager
2124
import org.schabi.newpipe.local.feed.service.FeedLoadService
2225
import java.util.concurrent.TimeUnit
@@ -59,7 +62,10 @@ class NotificationWorker(
5962
}
6063
.doOnError { throwable ->
6164
Log.e(TAG, "Error while displaying streams notifications", throwable)
62-
// TODO show error notification
65+
ErrorUtil.createNotification(
66+
applicationContext,
67+
ErrorInfo(throwable, UserAction.NEW_STREAMS_NOTIFICATIONS, "main worker")
68+
)
6369
}
6470
.onErrorReturnItem(Result.failure())
6571
} else {

0 commit comments

Comments
 (0)