Skip to content

Commit

Permalink
Merge pull request #7123 from tk0miya/7108_ConfigError_in_conf.py
Browse files Browse the repository at this point in the history
Close #7108: Allow to show an error message from conf.py via ConfigError
  • Loading branch information
tk0miya committed Feb 16, 2020
2 parents b4b971c + da64e5b commit be608ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Features added
* #3077: Implement the scoping for :rst:dir:`productionlist` as indicated
in the documentation.
* #1027: Support backslash line continuation in :rst:dir:`productionlist`.
* #7108: config: Allow to show an error message from conf.py via ``ConfigError``

Bugs fixed
----------
Expand Down
3 changes: 3 additions & 0 deletions sphinx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ def eval_config_file(filename: str, tags: Tags) -> Dict[str, Any]:
msg = __("The configuration file (or one of the modules it imports) "
"called sys.exit()")
raise ConfigError(msg)
except ConfigError:
# pass through ConfigError from conf.py as is. It will be shown in console.
raise
except Exception:
msg = __("There is a programmable error in your configuration file:\n\n%s")
raise ConfigError(msg % traceback.format_exc())
Expand Down

0 comments on commit be608ca

Please sign in to comment.