]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
replaced throwing exception in destructor with a trace and exit(1)
authorMichal Nowikowski <godfryd@isc.org>
Thu, 7 Mar 2019 09:56:14 +0000 (10:56 +0100)
committerMichal Nowikowski <godfryd@isc.org>
Thu, 7 Mar 2019 09:59:29 +0000 (10:59 +0100)
src/lib/testutils/sandbox.h

index 13aab6ed5c1f565a69e630208625088a7240a509..f030034e8f82a6e3f632bfa759586602283b7ec2 100644 (file)
 
 #include <iostream>
 #include <string>
+#include <cstring>
 #include <cstdlib>
 #include <cstdio>
+#include <cerrno>
 #include <unistd.h>
 #include <ftw.h>
 
@@ -46,7 +48,9 @@ public:
     ~Sandbox() {
         // Delete content of path_ recursively.
         if (nftw(path_.c_str(), Sandbox::rmFile, 10, FTW_DEPTH | FTW_MOUNT | FTW_PHYS) < 0) {
-            isc_throw(isc::Unexpected, "Some issue occured while deleting unit test sandbox.");
+            auto msg = "Some error occured while deleting unit test sandbox " + path_;
+            std::perror(msg.c_str());
+            exit(1);
         }
     }