Parcourir la source

Throw only std::invalid_argument in ctkLDAPSearchFilter

Sascha Zelzer il y a 14 ans
Parent
commit
f726b295b2
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  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)