mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7603 from eric-wieser/warning-as-error-traceback
Preserve exception info in raised SphinxWarning objects
This commit is contained in:
commit
f93e5a59b6
@ -412,9 +412,13 @@ class WarningIsErrorFilter(logging.Filter):
|
|||||||
message = record.msg # use record.msg itself
|
message = record.msg # use record.msg itself
|
||||||
|
|
||||||
if location:
|
if location:
|
||||||
raise SphinxWarning(location + ":" + str(message))
|
exc = SphinxWarning(location + ":" + str(message))
|
||||||
else:
|
else:
|
||||||
raise SphinxWarning(message)
|
exc = SphinxWarning(message)
|
||||||
|
if record.exc_info is not None:
|
||||||
|
raise exc from record.exc_info[1]
|
||||||
|
else:
|
||||||
|
raise exc
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user