mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Show the returned value in the error message
This commit is contained in:
parent
1a2f46389b
commit
41c7b7f150
@ -1607,10 +1607,8 @@ class TemplateFormatter(string.Formatter):
|
||||
ss = traceback.extract_tb(exc_info()[2])[-1]
|
||||
raise ValueError(_('Error in function {0} on line {1} : {2} - {3}').format(
|
||||
ss.name, ss.lineno, type(e).__name__, str(e)))
|
||||
|
||||
if not isinstance(rslt, str):
|
||||
raise ValueError(_('The Python template does not return a string'))
|
||||
|
||||
raise ValueError(_('The Python template returned a non-string value: {!r}').format(rslt))
|
||||
return rslt
|
||||
|
||||
def compile_python_template(self, template):
|
||||
|
Loading…
x
Reference in New Issue
Block a user