提交 a8b4fe0b authored 作者: Frederic's avatar Frederic

Do not crash when we try to add extra info to existing error

上级 13a0b2a8
...@@ -302,8 +302,15 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None): ...@@ -302,8 +302,15 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
"HINT: Use the Theano flag 'exception_verbosity=high'" "HINT: Use the Theano flag 'exception_verbosity=high'"
" for a debugprint and storage map footprint of this apply node.") " for a debugprint and storage map footprint of this apply node.")
try:
exc_value = exc_type(str(exc_value) + detailed_err_msg + exc_value = exc_type(str(exc_value) + detailed_err_msg +
'\n' + '\n'.join(hints)) '\n' + '\n'.join(hints))
except TypeError:
print("WARNING: %s error do not allow us to add extra error message" %
str(exc_type))
# Some exception need extra parameter in inputs. So forget the
# extra long error message in that case.
pass
reraise(exc_type, exc_value, exc_trace) reraise(exc_type, exc_value, exc_trace)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论