mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 13:33:12 +02:00
Improve printed error message if a template function fails to compile.
This commit is contained in:
parent
d33ac6795a
commit
1e275fc669
1 changed files with 7 additions and 1 deletions
|
|
@ -1707,7 +1707,13 @@ def compile_user_template_functions(funcs):
|
|||
cls = compile_user_function(*func)
|
||||
compiled_funcs[cls.name] = cls
|
||||
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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue