mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Improve printed error message if a template function fails to compile.
This commit is contained in:
parent
d33ac6795a
commit
1e275fc669
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user