8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8b1181c + 068ffce commit 394c367Copy full SHA for 394c367
lib/cron.js
@@ -375,7 +375,7 @@ var addCallback = function(callback) {
375
CronJob.prototype.addCallback = addCallback;
376
377
CronJob.prototype.setTime = function(time) {
378
- if (!(time instanceof CronTime)) throw '\'time\' must be an instance of CronTime.';
+ if (!(time instanceof CronTime)) throw new Error('\'time\' must be an instance of CronTime.');
379
this.stop();
380
this.cronTime = time;
381
}
tests/test-cron.js
@@ -365,7 +365,7 @@ module.exports = testCase({
365
job.stop();
366
assert.throws(function() {
367
job.setTime(time);
368
- });
+ }, Error, '\'time\' must be an instance of CronTime.');
369
370
clock.restore();
371
0 commit comments