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

Improve error message when a platform doesn't support a widget. #1992

Merged
merged 1 commit into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions android/src/toga_android/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ def not_implemented(feature):
"Paths",
"dialogs",
]


def __getattr__(name): # pragma: no cover
raise NotImplementedError(f"Toga's Android backend doesn't implement {name}")
1 change: 1 addition & 0 deletions changes/1992.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A more informative error message is returned when a platform backend doesn't support a widget.
4 changes: 4 additions & 0 deletions cocoa/src/toga_cocoa/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ def not_implemented(feature):
"WebView",
"Window",
]


def __getattr__(name): # pragma: no cover
raise NotImplementedError(f"Toga's Cocoa backend doesn't implement {name}")
4 changes: 4 additions & 0 deletions gtk/src/toga_gtk/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ def not_implemented(feature):
"WebView",
"Window",
]


def __getattr__(name): # pragma: no cover
raise NotImplementedError(f"Toga's GTK backend doesn't implement {name}")
4 changes: 4 additions & 0 deletions iOS/src/toga_iOS/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ def not_implemented(feature):
"WebView",
"Window",
]


def __getattr__(name): # pragma: no cover
raise NotImplementedError(f"Toga's iOS backend doesn't implement {name}")
4 changes: 4 additions & 0 deletions web/src/toga_web/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ def not_implemented(feature):
# 'WebView',
# 'Window',
]


def __getattr__(name): # pragma: no cover
raise NotImplementedError(f"Toga's Web backend doesn't implement {name}")
4 changes: 4 additions & 0 deletions winforms/src/toga_winforms/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ def not_implemented(feature):
"WebView",
"Window",
]


def __getattr__(name): # pragma: no cover
raise NotImplementedError(f"Toga's Winforms backend doesn't implement {name}")