Bug
1858298 - Improve error message when an action isn't implemented, r=Sasha
Actions typically work by looking for the implementation in an
executor-specific Protocol object. Since different executors implement
different things, these protocols are composed of many ProtocolParts,
which are accessed just through normal attribute lookup.
The problem is that this means that when we don't implement a
ProtocolPart in a given protocol we throw an AttributeError rather
than e.g. NotImplementedError. That means the harness doesn't deal
with the exception gracefully and ends up printing a trackback.
There are a few ways we could handle this:
* Ensure that each executor has at least a no-op implementation of
each ProtocolPart.
* Check on/before use of each ProtocolPart that it exists.
* Make failed attribute access on Protocol objects throw
NotImplementedError.
* Stop using attribute lookup syntax for accessing ProtocolParts.
All of these seem either quite verbose, or break normal Python object
protocols.
As a quick fix, if we get an AttributeError when trying to run an
action handler, and that error was thrown on the Protocol object,
re-raise it as a NotImplementedError.
This isn't a perfect fix, but it's relatively contained and fixes the
immediate problem without requiring larger refactors.
Differential Revision: https://phabricator.services.mozilla.com/
D190940