summaryrefslogtreecommitdiff
path: root/sphinx/errors.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-22 16:21:04 +0200
committerGeorg Brandl <georg@python.org>2014-09-22 16:21:04 +0200
commit1f23a5c369ba58c6ec5ab806e25c63dd615327dd (patch)
treebe37a9d8b8bc0b94da85227318617f9889473b21 /sphinx/errors.py
parent7bbaa4c73f9e0188d13360d981c25403393c13f6 (diff)
downloadsphinx-git-1f23a5c369ba58c6ec5ab806e25c63dd615327dd.tar.gz
Factor out parallel building into a utility class. Better error handling
with traceback of the parallel process saved in the error log.
Diffstat (limited to 'sphinx/errors.py')
-rw-r--r--sphinx/errors.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/sphinx/errors.py b/sphinx/errors.py
index 4d737e512..3d7a5eb47 100644
--- a/sphinx/errors.py
+++ b/sphinx/errors.py
@@ -10,6 +10,9 @@
:license: BSD, see LICENSE for details.
"""
+import traceback
+
+
class SphinxError(Exception):
"""
Base class for Sphinx errors that are shown to the user in a nicer
@@ -62,3 +65,13 @@ class PycodeError(Exception):
if len(self.args) > 1:
res += ' (exception was: %r)' % self.args[1]
return res
+
+
+class SphinxParallelError(Exception):
+ def __init__(self, orig_exc, traceback):
+ self.orig_exc = orig_exc
+ self.traceback = traceback
+
+ def __str__(self):
+ return traceback.format_exception_only(
+ self.orig_exc.__class__, self.orig_exc)[0].strip()