diff --git a/cmd/picomap/main.go b/cmd/picomap/main.go index 1cde157..615466b 100644 --- a/cmd/picomap/main.go +++ b/cmd/picomap/main.go @@ -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 } diff --git a/lib/client/client.go b/lib/client/client.go index 8bbad34..efe8676 100644 --- a/lib/client/client.go +++ b/lib/client/client.go @@ -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