diff --git a/src/pyproject_hooks/_impl.py b/src/pyproject_hooks/_impl.py index 14484fa..d82fdc2 100644 --- a/src/pyproject_hooks/_impl.py +++ b/src/pyproject_hooks/_impl.py @@ -53,8 +53,11 @@ def __init__( # Preserving arg order for the sake of API backward compatibility. self.backend_name = backend_name self.backend_path = backend_path - self.traceback = traceback - super().__init__(message or "Error while importing backend") + self.traceback = traceback or "" + super().__init__( + f"{message or 'Error while importing backend'}" + + (f"\n\nTraceback:\n{self.traceback}" if self.traceback else "") + ) class HookMissing(Exception):