From c10ffb119d6f5153b037aed36091c884b0ea9bc0 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 12 Jan 2023 11:19:54 +0000 Subject: [PATCH] trivial: Show a better error when reading am empty CFI flash ID --- plugins/ch341a/fu-ch341a-cfi-device.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/ch341a/fu-ch341a-cfi-device.c b/plugins/ch341a/fu-ch341a-cfi-device.c index d22653374..0745cf2f5 100644 --- a/plugins/ch341a/fu-ch341a-cfi-device.c +++ b/plugins/ch341a/fu-ch341a-cfi-device.c @@ -106,14 +106,17 @@ fu_ch341a_cfi_device_read_jedec(FuCh341aCfiDevice *self, GError **error) g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, - "flash ID non-valid"); + "flash ID non-valid, got 0x000000"); return FALSE; } if (buf[1] == 0xFF && buf[2] == 0xFF && buf[3] == 0xFF) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_NOT_SUPPORTED, - "device not detected"); + g_set_error(error, + FWUPD_ERROR, + FWUPD_ERROR_NOT_SUPPORTED, + "device not detected, flash ID 0x%02X%02X%02X", + buf[1], + buf[2], + buf[3]); return FALSE; } g_string_append_printf(flash_id, "%02X", buf[1]);