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

@@ -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