Prevent a single faulty ScriptableObject from breaking script handling altogether (#5446)#11166
Merged
Merged
Conversation
Collaborator
Therefore, I think changes for developers fits. |
LeonarddeR
reviewed
May 15, 2020
feerrenrut
reviewed
May 15, 2020
Co-authored-by: Leonard de Ruijter <leonardder@users.noreply.github.com>
Contributor
Author
I directly edited the PR description for clarity with a proposed change log entry. |
Co-authored-by: Reef Turner <feerrenrut@users.noreply.github.com>
feerrenrut
approved these changes
Jun 11, 2020
feerrenrut
left a comment
Contributor
There was a problem hiding this comment.
Thanks @JulienCochuyt, I'll merge this shortly
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:
Fixes #5446
Summary of the issue:
Currently, if
ScriptableObject.getScriptraises an exception, the wholescriptHandler.findScriptfails, andInputManager.executeGesturefails with it.The sooner the incriminated
ScriptableObjectis looked upon duringscriptHandler.findScript, the most blocking is the result.A common example is missing to call
super().__init__in aGlobalPlugin, but other scenarios could easily be encountered as well in other dynamic script binding situations.This issue typically strikes beginner blind developers, and I guess we especially don't want to harden the path for them, notably because many of us walked it before.
Description of how this pull request fixes the issue:
scriptHandler.findScript, catch any exception thrown byScriptableObject.getScript, log the error, but keep on processing.ScriptableObject.getScript, catch theAttributeErroremitted when accessingself._gestureMapwith an uninitialized base class and log an informative diagnostic message.Testing performed:
Tested with a
GlobalPluginthat misses to initialize its base class.Checks that errors are logged, but NVDA keeps functioning normally.
Known issues with pull request:
Change log entry:
Section: Changes for developers
A broken
ScriptableObject- such as aGlobalPluginmissing to call the__init__method of its base class - does not break anymore NVDA's script handling altogether.