| ... | @@ -221,13 +221,10 @@ client.on('invalidated', function () { | ... | @@ -221,13 +221,10 @@ client.on('invalidated', function () { |
| 221 | }); | 221 | }); |
| 222 | | 222 | |
| 223 | // Client warning handler (which might not require restarting but just to be safe.) | 223 | // Client warning handler (which might not require restarting but just to be safe.) |
| 224 | client.on('error', function (info) { | 224 | client.on('warn', function (info) { |
| 225 | // Writes a log of what happened to a log file. | 225 | // Writes a log of what happened to a log file. |
| 226 | fs.writeFileSync( | 226 | fs.writeFileSync( |
| 227 | path.join('logs', `${Date.now()}.warn`), | 227 | path.join('logs', `${Date.now()}.warn`), |
| 228 | `Warning: ${info}` | 228 | `Warning: ${info}` |
| 229 | ); | 229 | ); |
| 230 | | | |
| 231 | // Exits the process (and hopefully restarts!) | | |
| 232 | process.exit(); | | |
| 233 | }); | 230 | }); |