mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-04-20 03:25:14 +00:00
Show more detail in error notifications
This commit is contained in:
parent
8dc2112e2d
commit
e3820fd7d3
3 changed files with 5 additions and 1 deletions
|
@ -30,6 +30,8 @@ interface CanNotifyModel : Serializable {
|
|||
fun notifyName(): String
|
||||
|
||||
fun notifyTag(): String
|
||||
|
||||
fun notifyDescription(): String?
|
||||
}
|
||||
|
||||
/** @author Aidan Follestad (@afollestad) */
|
||||
|
|
|
@ -53,6 +53,8 @@ data class Site(
|
|||
|
||||
override fun notifyTag(): String = url
|
||||
|
||||
override fun notifyDescription() = lastResult?.reason
|
||||
|
||||
fun intervalText(): String {
|
||||
requireNotNull(settings) { "Settings not queried." }
|
||||
val lastCheck = lastResult?.timestampMs ?: -1
|
||||
|
|
|
@ -73,7 +73,7 @@ class RealNockNotificationManager(
|
|||
val newNotification = notificationProvider.create(
|
||||
channelId = CheckFailures.id,
|
||||
title = model.notifyName(),
|
||||
content = stringProvider.get(R.string.something_wrong),
|
||||
content = model.notifyDescription() ?: stringProvider.get(R.string.something_wrong),
|
||||
intent = intent,
|
||||
smallIcon = R.drawable.ic_notification
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue