From 3cfc7ef09bfd2ebc07c0dc85b4425d8ad3d690fd Mon Sep 17 00:00:00 2001 From: Joseph Huckaby Date: Wed, 27 Nov 2019 14:18:01 -0800 Subject: [PATCH] Version 0.8.37 Now correctly throwing an error instead of crashing when starting a job and the event's category, plugin, or server group cannot be found. --- lib/job.js | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/job.js b/lib/job.js index 2a68fd16..49e29193 100644 --- a/lib/job.js +++ b/lib/job.js @@ -106,6 +106,10 @@ module.exports = Class.create({ function(err) { // all resources loaded if (err) return callback(err); + if (!server_group && !servers.length) return callback( new Error("Server or Server Group not found: " + event.target) ); + if (!plugin) return callback( new Error("Plugin not found: " + event.plugin) ); + if (!category) return callback( new Error("Category not found: " + event.category) ); + if (!orig_event) return callback( new Error("Event not found: " + event.id) ); var all_jobs = self.getAllActiveJobs(true); // include pending jobs var job_list = Tools.hashValuesToArray( all_jobs ); diff --git a/package.json b/package.json index fc9e9f93..e470e497 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Cronicle", - "version": "0.8.36", + "version": "0.8.37", "description": "A simple, distributed task scheduler and runner with a web based UI.", "author": "Joseph Huckaby ", "homepage": "https://github.com/jhuckaby/Cronicle",