We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00bc922 commit 6dd0699Copy full SHA for 6dd0699
src/commonMain/kotlin/io/rebble/libpebblecommon/structmapper/StructMapper.kt
@@ -35,8 +35,13 @@ class StructMapper: Mappable {
35
}
36
37
override fun fromBytes(bytes: DataBuffer) {
38
- getStruct().forEach {
39
- it.fromBytes(bytes)
+ getStruct().forEachIndexed { i: Int, mappable: Mappable ->
+ try {
40
+ mappable.fromBytes(bytes)
41
+ }catch (e: Exception) {
42
+ throw PacketDecodeException("Unable to deserialize mappable ${mappable::class.simpleName} at index $i (${mappable})", e)
43
+ }
44
+
45
46
47
0 commit comments