提交 a713fb34 authored 作者: James Bergstra's avatar James Bergstra

added reason to bug-print in replace_validate

上级 e629abd5
...@@ -102,7 +102,7 @@ class ReplaceValidate(History, Validator): ...@@ -102,7 +102,7 @@ class ReplaceValidate(History, Validator):
env.replace(r, new_r, reason=reason) env.replace(r, new_r, reason=reason)
except Exception, e: except Exception, e:
if 'The type of the replacement must be the same' not in str(e) and 'does not belong to this Env' not in str(e): if 'The type of the replacement must be the same' not in str(e) and 'does not belong to this Env' not in str(e):
print >>sys.stderr, "<<!! BUG IN ENV.REPLACE OR A LISTENER !!>>", type(e), e print >> sys.stderr, "<<!! BUG IN ENV.REPLACE OR A LISTENER !!>>", type(e), e, reason
env.revert(chk) # this might fail if the error is in a listener: (env.replace kinda needs better internal error handling) env.revert(chk) # this might fail if the error is in a listener: (env.replace kinda needs better internal error handling)
raise raise
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论