mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #1591 from davep/compose-error-expand
Reraise compose TypeError from the error rather than None
This commit is contained in:
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- `COMPONENT_CLASSES` are now inherited from base classes https://github.com/Textualize/textual/issues/1399
|
||||
- Watch methods may now take no parameters
|
||||
- Added `compute` parameter to reactive
|
||||
- A `TypeError` raised during `compose` now carries the full traceback.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
@@ -1569,7 +1569,7 @@ class App(Generic[ReturnType], DOMNode):
|
||||
except TypeError as error:
|
||||
raise TypeError(
|
||||
f"{self!r} compose() returned an invalid response; {error}"
|
||||
) from None
|
||||
) from error
|
||||
await self.mount_all(widgets)
|
||||
|
||||
def _on_idle(self) -> None:
|
||||
|
||||
@@ -2395,7 +2395,7 @@ class Widget(DOMNode):
|
||||
except TypeError as error:
|
||||
raise TypeError(
|
||||
f"{self!r} compose() returned an invalid response; {error}"
|
||||
) from None
|
||||
) from error
|
||||
except Exception:
|
||||
self.app.panic(Traceback())
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user