diff --git a/frappe/translate.py b/frappe/translate.py index 85619a3a6a..aeca758a9d 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -548,8 +548,12 @@ def extract_messages_from_code(code): try: code = frappe.as_unicode(render_include(code)) - except (TemplateError, ImportError, InvalidIncludePath, IOError): - # Exception will occur when it encounters John Resig's microtemplating code + + # Exception will occur when it encounters John Resig's microtemplating code + except (TemplateError, ImportError, InvalidIncludePath, IOError) as e: + if isinstance(e, InvalidIncludePath): + frappe.clear_last_message() + pass messages = []