Node.js - Cluster Module
Identify the error in this code snippet that tries to restart a worker after it crashes:
const cluster = require('cluster');
if (cluster.isMaster) {
cluster.fork();
cluster.on('exit', (worker) => {
console.log('Worker crashed, restarting...');
cluster.fork();
});
}