From fd75807a9b67c5534b2b676958558e7ba74b6547 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 26 Jan 2025 11:11:27 +0530 Subject: [PATCH] Output the hresult when getting properties fails --- src/calibre/devices/mtp/windows/content_enumeration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/mtp/windows/content_enumeration.cpp b/src/calibre/devices/mtp/windows/content_enumeration.cpp index 270792f7fd..6a0e23ae25 100644 --- a/src/calibre/devices/mtp/windows/content_enumeration.cpp +++ b/src/calibre/devices/mtp/windows/content_enumeration.cpp @@ -209,8 +209,8 @@ single_get_filesystem(unsigned int level, CComPtr &conte pyobject_raii item(get_object_properties(devprops, properties, pv.pwszVal, &get_properties_failed)); if (!item) { if (!get_properties_failed) return false; - fprintf(stderr, "Ignoring object with id: %ls because getting its properties failed.\n", pv.pwszVal); - if (PyErr_Occurred()) PyErr_Clear(); + fprintf(stderr, "Ignoring object with id: %ls because getting its properties failed with error:\n", pv.pwszVal); + if (PyErr_Occurred()) PyErr_Print(); continue; } if (PyDict_SetItem(ans, PyDict_GetItemString(item.ptr(), "id"), item.ptr()) != 0) return false;