Report the actual interval that was sent if less than 1000ms.

This change reports the actual interval that was used instead of just reporting the ms of the interval if the interval was less than 1000ms.

Fixes elastic/elasticsearch#301

Original commit: elastic/x-pack-elasticsearch@d625c952fe
This commit is contained in:
Brian Murphy 2015-04-30 14:31:28 -04:00
parent d0d646aa4c
commit 9df97fe845
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ public class IntervalSchedule implements Schedule {
public IntervalSchedule(Interval interval) {
if (interval.millis < 1000) {
throw new ScheduleTriggerException("interval can't be lower than 1000 ms, but [{}] was specified", interval.millis);
throw new ScheduleTriggerException("interval can't be lower than 1000 ms, but [{}] was specified", interval);
}
this.interval = interval;
}

View File

@ -339,7 +339,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTests {
.get();
fail("put watch should have failed");
} catch (ScheduleTriggerException e) {
assertThat(e.getMessage(), equalTo("interval can't be lower than 1000 ms, but [-5000] was specified"));
assertThat(e.getMessage(), equalTo("interval can't be lower than 1000 ms, but [-5s] was specified"));
}
try {