Improve printed error message if a template function fails to compile.

This commit is contained in:
Charles Haley 2020-05-21 18:11:55 +01:00
parent d33ac6795a
commit 1e275fc669

View File

@ -1707,7 +1707,13 @@ def compile_user_template_functions(funcs):
cls = compile_user_function(*func) cls = compile_user_function(*func)
compiled_funcs[cls.name] = cls compiled_funcs[cls.name] = cls
except: except:
traceback.print_exc() try:
func_name = func[0]
except:
func_name = 'Unknown'
print('**** Compilation errors in user template function "%s" ****' % func_name)
traceback.print_exc(limit=0)
print('**** End compilation errors in %s "****"' % func_name)
return compiled_funcs return compiled_funcs