Problem/Motivation
This is an idea for error message improvement for site admins and developers.
When a Rules reaction rule failed to get a parameter, a error message like the following one is logged with watchdog.
Unable to get variable user, it is not defined.
Unable to get variable node, it is not defined.
This is helpful to detect the problematic reaction rule when a site has a small set of reaction rules. But if a site has a large number of reaction rules, for example, hundreds, the message is not very informative and debugging is hard. If more information is provided in the message, admins and developers can easily detect problematic reaction rules.
(I'd like to propose this though I know of the existing debug function of Rules module. The existing function is useful but sometimes generates too many log messages and overwhelming.)
Proposed resolution
Add the plugin name which raised the exception (which leads to the error log) into the error message.
The image below is a sample capture after applying the patch.
Remaining tasks
- Create a patch
- Review the patch
User interface changes
(None)
API changes
(None)
Data model changes
(None)
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff-2875575-2-4.txt | 678 bytes | hgoto |
#4 | rules-make_error_message_more_informative-2875575-4.patch | 4.75 KB | hgoto |
| |||
#2 | 2875575-2.png | 25.69 KB | hgoto |
Comments
Comment #2
hgoto CreditAttribution: hgoto at Studio Umi commentedI made a first trial patch.
Here are some points.
RulesState
. Instances ofRulesState
don't have any label for human and I'd like to use the parent plugin label instead. For that, we need to add a reference fromRulesState
toRulesPlugin
.test/rules.test
is included in this patch. This change is actually not necessary but I'd like to fix this as the constructor ofRulesState
originally doesn't take any arguments.I'd like this to be reviewed.
The attached image is a sample capture after applying the patch.
Comment #4
hgoto CreditAttribution: hgoto at Studio Umi commentedOops. There was a test which validates the error message. I adjusted the test.
Comment #5
hgoto CreditAttribution: hgoto at Studio Umi commentedComment #6
TR CreditAttribution: TR commentedI agree, this would be a big usability improvement.