[Erp5-report] r40201 nicolas.dumazet - /erp5/trunk/products/ERP5Type/dynamic/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 11 03:11:44 CET 2010


Author: nicolas.dumazet
Date: Thu Nov 11 03:11:44 2010
New Revision: 40201

URL: http://svn.erp5.org?rev=40201&view=rev
Log:
improve error messages

Modified:
    erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py

Modified: erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py?rev=40201&r1=40200&r2=40201&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] Thu Nov 11 03:11:44 2010
@@ -129,11 +129,16 @@ def generatePortalTypeClass(portal_type_
     mixin_list = []
     interface_list = []
 
-  type_class_path = document_class_registry.get(type_class)
-  if type_class_path is None:
+  if type_class is None:
     raise AttributeError('Document class is not defined on Portal Type %s' \
             % portal_type_name)
 
+  type_class_path = document_class_registry.get(type_class)
+  if type_class_path is None:
+    raise AttributeError('Document class %s has not been registered:' \
+                         ' cannot import it as base of Portal Type %s' \
+                         % (type_class, portal_type_name))
+
   klass = _importClass(type_class_path)
 
   ## Disabled because there will be no commit of




More information about the Erp5-report mailing list