Return error on inner decode failure instead of hanging, split flash-status output

This commit is contained in:
Ian Gulliver
2026-04-12 22:27:21 +09:00
parent 11c101c235
commit cc37b711a4
2 changed files with 5 additions and 10 deletions

View File

@@ -224,15 +224,10 @@ func cmdFlashStatus(args []string) error {
slog.Error("flash-status error", "via", t.name, "err", err)
continue
}
slog.Info("flash-status",
"via", t.name,
"boot_partition", status.BootPartition,
"slot_a_valid", status.SlotA.Valid,
"slot_a_version", status.SlotA.Version,
"slot_a_hash_ok", status.SlotA.HashOK,
"slot_b_valid", status.SlotB.Valid,
"slot_b_version", status.SlotB.Version,
"slot_b_hash_ok", status.SlotB.HashOK)
log := slog.With("via", t.name)
log.Info("flash-status", "boot_partition", status.BootPartition)
log.Info("slot-a", "valid", status.SlotA.Valid, "version", status.SlotA.Version, "hash_ok", status.SlotA.HashOK)
log.Info("slot-b", "valid", status.SlotB.Valid, "version", status.SlotB.Version, "hash_ok", status.SlotB.HashOK)
}
return nil
}

View File

@@ -75,7 +75,7 @@ func roundTrip[T any](c *Client, req any) ([]Response[T], error) {
}
var inner any
if err := msgpack.Unmarshal(env.Payload, &inner); err != nil {
continue
return nil, fmt.Errorf("decode response: %w", err)
}
if devErr, ok := inner.(*DeviceError); ok {
return nil, devErr