diff --git a/lib/cluster.exception.js b/lib/cluster.exception.js index 77ed87c..54eca2b 100644 --- a/lib/cluster.exception.js +++ b/lib/cluster.exception.js @@ -246,7 +246,13 @@ exports = module.exports = function exception (options) { console.error(error.stack || error.message); // report exception - instance.master.call('workerException', error) + if (instance.master) { + // cluster with server + instance.master.call('workerException', error) + } else { + // cluster without server + instance.call('workerException', error) + } // exit process.nextTick(function (){