Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception when composing a child widget seems to stop the app but not error out #1177

Closed
davep opened this issue Nov 15, 2022 · 2 comments

Comments

@davep
Copy link
Contributor

davep commented Nov 15, 2022

Just noting this one here so I don't forget, as I noticed it while looking into something else and I want to come back and check what this is about (or anyone else can dive in, of course).

Given this code:

from textual.app import App, ComposeResult
from textual.widgets import Static
from textual.containers import Container

class Question( Container ):

    def __init__( self, error_out: bool ) -> None:
        self.error_out = error_out
        super().__init__()

    def compose( self ) -> ComposeResult:
        wut = 1 / int( not self.error_out )
        yield Static( f"How did I get here? ({wut})" )

class Crashy( App ):

    def compose( self ) -> ComposeResult:
        yield Question( False )
        yield Question( True )

Crashy().run()

The app doesn't complete rendering, but at the same time it doesn't stop and indicate an error. The error is shown once the app is Ctrl+Cd out.

@darrenburns
Copy link
Member

This should be fixed by #1505

@github-actions
Copy link

github-actions bot commented Jan 6, 2023

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants