catch serialization
This commit is contained in:
parent
9b6477381b
commit
e1423c0f82
1 changed files with 6 additions and 2 deletions
|
@ -14,7 +14,11 @@ sealed class EventData : Event() {
|
|||
|
||||
companion object {
|
||||
|
||||
fun deserialize(json: String) = Json.decodeFromString(serializer(), json)
|
||||
fun deserialize(json: String) = try {
|
||||
Json.decodeFromString(serializer(), json)
|
||||
} catch (ignored: Exception) {
|
||||
Error(System.currentTimeMillis())
|
||||
}
|
||||
}
|
||||
|
||||
// Mobile <- Wear
|
||||
|
@ -234,7 +238,7 @@ sealed class EventData : Event() {
|
|||
|
||||
@Serializable // returnCommand is sent back to Mobile after confirmation
|
||||
data class ConfirmAction(val title: String, val message: String, val returnCommand: EventData?) : EventData()
|
||||
|
||||
|
||||
@Serializable
|
||||
data class SnoozeAlert(val timeStamp: Long) : EventData()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue