diff --git a/CEP/MS/src/combinevds.cc b/CEP/MS/src/combinevds.cc
index 41d90406384afe23241501038aee315ad041d5b4..1a9676d7c9712325111c93ebdc189a4a9cc42a06 100644
--- a/CEP/MS/src/combinevds.cc
+++ b/CEP/MS/src/combinevds.cc
@@ -30,6 +30,9 @@ using namespace std;
 using namespace LOFAR;
 using namespace LOFAR::CEP;
 
+// Define handler that tries to print a backtrace.
+Exception::TerminateHandler t(Exception::terminate);
+
 int main (int argc, const char* argv[])
 {
   try {
@@ -46,8 +49,8 @@ int main (int argc, const char* argv[])
     // Combine them.
     VdsMaker::combine (argv[1], vdsNames);
 
-  } catch (exception& x) {
-    cout << "Unexpected expection: " << x.what() << endl;
+  } catch (LOFAR::Exception& err) {
+    std::cerr << "LOFAR Exception detected: " << err << std::endl;
     return 1;
   }
   return 0;
diff --git a/CEP/MS/src/makevds.cc b/CEP/MS/src/makevds.cc
index 818985ad6914238815f4d8ca919746cc0523282c..a6157e4b7c0dcb791986e29d59e11a6e9a986763 100644
--- a/CEP/MS/src/makevds.cc
+++ b/CEP/MS/src/makevds.cc
@@ -25,14 +25,18 @@
 #include<stdexcept>
 #include <iostream>
 
+using namespace LOFAR;
 using namespace std;
 
+// Define handler that tries to print a backtrace.
+Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, const char* argv[])
 {
   try {
     if (argc < 3  ||  argv[1][0] == '\0'  ||  argv[2][0] == '\0') {
-      cout << "Run as:  makevds clusterdesc ms [msvds] [hostname] [writetimes]" << endl;
+      cout << "Run as:  makevds clusterdesc ms [msvds] [hostname] [writetimes]"
+           << endl;
       cout << "  default vds name is <ms>.vds" << endl;
       cout << "  default host name is gethostname()" << endl;
       cout << "  default writetimes is false (0)" << endl;
@@ -58,8 +62,8 @@ int main(int argc, const char* argv[])
       writeTimes = (argv[5][0]=='t' || argv[5][0]=='T' || argv[5][0]=='1');
     }
     LOFAR::VdsMaker::create (argv[2], msvds, argv[1], hostName, writeTimes);
-  } catch (exception& x) {
-    cout << "Unexpected expection: " << x.what() << endl;
+  } catch (LOFAR::Exception& err) {
+    std::cerr << "LOFAR Exception detected: " << err << std::endl;
     return 1;
   }
   return 0;