Viewing Issue Advanced Details

ID 0003922 Category [DMDirc] *Unsorted Severity minor
Reproducibility always Date Submitted 2010-03-12 18:33 Last Update 2010-03-13 19:36
Reporter Dataforce Assigned To MD87 View Status public
Priority normal Status resolved Resolution fixed
Platform Fixed in Version Target Version 0.6.4
Product Version Product Build
Summary 0003922: "Invalid Perform" error should say what is invalid about it.
Description
"Invalid Perform" error should say what is invalid about it.
Needs unit test no
Upstream Bug URL

Relationships

Notes

A patchset (1) related to this change has been added to gerrit by Chris Smith

Elaborate on perform action errors

Fixes issue 3922

Change-Id: Ib2621550852bc556dec46fe2681a82cdac1b69b5
authorChris Smith <chris@dmdirc.com>2010-03-13 18:19:08 (GMT)
committer Shane Mc Cormack <shane@dmdirc.com>2010-03-13 19:35:49 (GMT)
commit91b917dece67b88c8258a9bbe1b540a613a9360d (patch) (side-by-side diff)
Elaborate on perform action errors
Fixes issue 3922 Change-Id: Ib2621550852bc556dec46fe2681a82cdac1b69b5 Reviewed-on: http://gerrit.dmdirc.com/1016 Reviewed-by: Shane Mc Cormack <shane@dmdirc.com> Automatic-Compile: Shane Mc Cormack <shane@dmdirc.com>
-rw-r--r--src/com/dmdirc/actions/wrappers/PerformWrapper.java21
1 files changed, 16 insertions, 5 deletions
Click to Expand/Collapse
diff src/com/dmdirc/actions/wrappers/PerformWrapper.java
@@ -71,12 +71,23 @@ public class PerformWrapper extends ActionGroup {
/** {@inheritDoc} */
@Override
public void add(final Action action) {
- if (action.getTriggers().length == 1
- && action.getTriggers()[0] == CoreActionType.SERVER_CONNECTED
- && checkConditions(action.getConditions())) {
- super.add(action);
+ if (action.getTriggers().length != 1) {
+ Logger.userError(ErrorLevel.MEDIUM,
+ "Invalid perform action: " + action.getName(),
+ "Perform actions may only have one trigger");
+ } else if (action.getTriggers()[0] != CoreActionType.SERVER_CONNECTED) {
+ Logger.userError(ErrorLevel.MEDIUM,
+ "Invalid perform action: " + action.getName(),
+ "Perform actions must be triggered when a server connects");
+ } else if (!checkConditions(action.getConditions())) {
+ Logger.userError(ErrorLevel.MEDIUM,
+ "Invalid perform action: " + action.getName(),
+ "Perform actions must have exactly one or two conditions, "
+ + "one may target the server's name or network, and one may "
+ + "target the server's profile name. No other targets are "
+ + "allowed.");
} else {
- Logger.userError(ErrorLevel.MEDIUM, "Invalid perform action: " + action.getName());
+ super.add(action);
}
}

Issue History

Date Modified Username Field Change
2010-03-12 18:33 Dataforce New Issue
2010-03-12 18:33 Dataforce Status new => assigned
2010-03-12 18:33 Dataforce Assigned To => MD87
2010-03-13 18:21 Version Control Checkin
2010-03-13 18:21 Version Control Note Added: 0010325
2010-03-13 18:21 Version Control Status assigned => fix pending
2010-03-13 19:36 MD87 Checkin
2010-03-13 19:36 MD87 Note Added: 0010333
2010-03-13 19:36 MD87 Status fix pending => resolved
2010-03-13 19:36 MD87 Resolution open => fixed