From 18903d77d11fcf777455e1cc8616f01f630ad07f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 23 Sep 2016 21:44:03 +0530 Subject: [PATCH] [minor] print doctype and module name if broken --- frappe/modules/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frappe/modules/__init__.py b/frappe/modules/__init__.py index d271efa8fb..edd45e4e6e 100644 --- a/frappe/modules/__init__.py +++ b/frappe/modules/__init__.py @@ -60,8 +60,14 @@ def load_doctype_module(doctype, module=None, prefix="", suffix=""): key = (app, doctype, prefix, suffix) - if key not in doctype_python_modules: - doctype_python_modules[key] = frappe.get_module(get_module_name(doctype, module, prefix, suffix)) + module_name = get_module_name(doctype, module, prefix, suffix) + + try: + if key not in doctype_python_modules: + doctype_python_modules[key] = frappe.get_module(module_name) + except ImportError: + print 'Module import failed for {0} ({1})'.format(doctype, module_name) + raise return doctype_python_modules[key]