debuginfod: print filename for "cannot open archive" error
authorMartin Liska <mliska@suse.cz>
Wed, 17 Aug 2022 07:11:10 +0000 (09:11 +0200)
committerMartin Liska <mliska@suse.cz>
Wed, 17 Aug 2022 11:50:07 +0000 (13:50 +0200)
Report the file that has such a problem so that one can inspect it.

Signed-off-by: Martin Liska <mliska@suse.cz>
debuginfod/debuginfod.cxx

index 9245be5..366a4a0 100644 (file)
@@ -1714,7 +1714,10 @@ handle_buildid_r_match (bool internal_req_p,
 
   rc = archive_read_open_FILE (a, fp);
   if (rc != ARCHIVE_OK)
-    throw archive_exception(a, "cannot open archive from pipe");
+    {
+      obatched(clog) << "cannot open archive from pipe " << b_source0 << endl;
+      throw archive_exception(a, "cannot open archive from pipe");
+    }
 
   // archive traversal is in three stages, no, four stages:
   // 1) skip entries whose names do not match the requested one
@@ -2973,7 +2976,10 @@ archive_classify (const string& rps, string& archive_extension,
 
   rc = archive_read_open_FILE (a, fp);
   if (rc != ARCHIVE_OK)
-    throw archive_exception(a, "cannot open archive from pipe");
+    {
+      obatched(clog) << "cannot open archive from pipe " << rps << endl;
+      throw archive_exception(a, "cannot open archive from pipe");
+    }
 
   if (verbose > 3)
     obatched(clog) << "libarchive scanning " << rps << endl;