diff options
author | Ram Rachum <ram@rachum.com> | 2020-06-14 00:46:19 +0300 |
---|---|---|
committer | Ram Rachum <ram@rachum.com> | 2020-06-14 14:37:16 +0300 |
commit | 53c1dff91c0b7100e1ce1b51acbf0fffbc10cf9c (patch) | |
tree | 93bca0f98dfcf0f83f32987f898a7fbafe8f25dd /sphinx/environment/__init__.py | |
parent | 0fc97a0b56d31f2703ff42dfe946e8d11d667909 (diff) | |
download | sphinx-git-53c1dff91c0b7100e1ce1b51acbf0fffbc10cf9c.tar.gz |
Fix exception causes all over the codebase
Diffstat (limited to 'sphinx/environment/__init__.py')
-rw-r--r-- | sphinx/environment/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index 6584ac6d8..1e58542bb 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -393,7 +393,8 @@ class BuildEnvironment: if catalog.domain == domain: self.dependencies[docname].add(catalog.mo_path) except OSError as exc: - raise DocumentError(__('Failed to scan documents in %s: %r') % (self.srcdir, exc)) + raise DocumentError(__('Failed to scan documents in %s: %r') % + (self.srcdir, exc)) from exc def get_outdated_files(self, config_changed: bool) -> Tuple[Set[str], Set[str], Set[str]]: """Return (added, changed, removed) sets.""" @@ -511,8 +512,8 @@ class BuildEnvironment: """ try: return self.domains[domainname] - except KeyError: - raise ExtensionError(__('Domain %r is not registered') % domainname) + except KeyError as exc: + raise ExtensionError(__('Domain %r is not registered') % domainname) from exc # --------- RESOLVING REFERENCES AND TOCTREES ------------------------------ |