Kaynağa Gözat

Throw only std::invalid_argument in ctkLDAPSearchFilter

Sascha Zelzer 14 yıl önce
ebeveyn
işleme
f726b295b2
1 değiştirilmiş dosya ile 9 ekleme ve 1 silme
  1. 9 1
      Libs/PluginFramework/ctkLDAPSearchFilter.cpp

+ 9 - 1
Libs/PluginFramework/ctkLDAPSearchFilter.cpp

@@ -49,8 +49,16 @@ ctkLDAPSearchFilter::ctkLDAPSearchFilter()
 }
 
 ctkLDAPSearchFilter::ctkLDAPSearchFilter(const QString& filter)
-  : d(new ctkLDAPSearchFilterData(filter))
+  : d(0)
 {
+  try
+  {
+    d = new ctkLDAPSearchFilterData(filter);
+  }
+  catch (const std::exception& e)
+  {
+    throw std::invalid_argument(e.what());
+  }
 }
 
 ctkLDAPSearchFilter::ctkLDAPSearchFilter(const ctkLDAPSearchFilter& other)