Skip to content

Commit 51e84d7

Browse files
authored
Merge pull request #219 from bbhtt/bbhtt/show-traceback-outputjson
Show traceback from output.json on BackendUnavailable
2 parents a9af158 + 763714a commit 51e84d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pyproject_hooks/_impl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ def __init__(
5353
# Preserving arg order for the sake of API backward compatibility.
5454
self.backend_name = backend_name
5555
self.backend_path = backend_path
56-
self.traceback = traceback
57-
super().__init__(message or "Error while importing backend")
56+
self.traceback = traceback or ""
57+
super().__init__(
58+
f"{message or 'Error while importing backend'}"
59+
+ (f"\n\nTraceback:\n{self.traceback}" if self.traceback else "")
60+
)
5861

5962

6063
class HookMissing(Exception):

0 commit comments

Comments
 (0)