Log errors during data removal 11/323711/6
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 31 Mar 2025 15:00:20 +0000 (17:00 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 14 May 2025 13:29:57 +0000 (13:29 +0000)
Change-Id: I6ed087ac1794ab3249c0915047187a0f832e85a9

src/ckm/ckm-common.cpp

index bd2adba4afd4fd4407c20dd39df24571f9b16984..379a9f6987a7eac63387defa48ca9b8e97f702f3 100644 (file)
@@ -214,11 +214,13 @@ ScopedRemoveData::~ScopedRemoveData()
     if (!SamePid())
         return;
 
-    /*
-     * Let it throw. If we can't remove data then remaining tests results will be
-     * unreliable anyway.
-     */
-    check_remove_allowed(m_alias);
+    try {
+        check_remove_allowed(m_alias);
+    } catch (const DPL::Test::TestException& e) {
+        RUNNER_ERROR_MSG("TestException in ScopedAppContext destructor: " << e.GetMessage());
+    } catch (...) {
+        RUNNER_ERROR_MSG("Unknown exception in ScopedAppContext destructor");
+    }
 }
 
 ScopedSaveData::ScopedSaveData(const std::string& alias,