Document gui.message.DisplayableError in the Developer Guide#20504
Open
danielw97 wants to merge 1 commit into
Open
Document gui.message.DisplayableError in the Developer Guide#20504danielw97 wants to merge 1 commit into
danielw97 wants to merge 1 commit into
Conversation
…s#16984) Add a "Displaying errors to the user" section under "Communicating with the user", describing when to use DisplayableError, the raise/route/handle pattern, and example usage based on the Add-on Store. Add a gui.message entry to the Extension Points chapter cross-referencing it, and expand the DisplayableError.__init__ docstring so the class is documented.
danielw97
marked this pull request as ready for review
July 15, 2026 15:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Closes #16984
Summary of the issue:
gui.message.DisplayableErroris an exception class that pairs with anextensionPoints.Actionto present user-friendly errors via a message box, letting non-GUI code report a failure without deciding how it is displayed. It was undocumented: it had no entry in the Extension Points chapter of the Developer Guide, no explanation of when it should (and shouldn't) be used, and no usage examples. Its only docstring was attached to theOnDisplayableErrorTalias, leaving the class itself effectively undocumented.Description of user facing changes:
None. This is a documentation and developer-facing change only.
Description of developer facing changes:
DisplayableErroris for, when to use it and when not to, and the raise / route / handle pattern, with short examples based on the Add-on Store's real usage.gui.messageentry noting thatDisplayableError.OnDisplayableErrorTis anActiontype that components instantiate per-use, cross-referencing the new section.DisplayableError.__init__now carries a docstring describing the class and its intended usage, so the class is documented at the point developers are most likely to look.Description of development approach:
Following the discussion on the issue, the prose lives under "Communicating with the user" (which already documents the rest of
gui.message) rather than only in the Extension Points chapter, so the explanation and examples sit alongside the related message dialog API. Per @seanbudd's suggestion on the issue, the class documentation was added to the existing__init__docstring rather than as a separate class-level docstring.The examples were derived from examining the existing Add-on Store usage:
DisplayableErroris raised inaddonStore.installandaddonStore.network, routed throughgui.addonStoreGui.viewModels.store.AddonStoreVM.onDisplayableError, and handled bygui.addonStoreGui.controls.storeDialog.AddonStoreDialog. The documented pattern reflects that flow, including thecore.callLaterhop used to ensure handlers run on the main thread when the error may be raised on a background thread, and the option for a handler to only log (asUpdatableAddonsDialogdoes for the automatic add-on update check).Testing strategy:
ruff checkandruff formaton the changedsource/gui/message.py; both pass. Ranpyrighton the file: 0 errors, 0 warnings.Known issues with pull request:
None.
Code Review Checklist: