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 {
|
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
|
// Mobile <- Wear
|
||||||
|
|
Loading…
Reference in a new issue