forked from svrjs/svrjs
Lint out the codebase
This commit is contained in:
parent
58cb60fb8f
commit
95416f4604
1 changed files with 11 additions and 4 deletions
|
@ -19,7 +19,9 @@ function serverErrorHandler(err, isRedirect, server, start) {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
process.send("\x12ERRLIST" + (isRedirect ? attmtsRedir : attmts) + err.code);
|
process.send(
|
||||||
|
"\x12ERRLIST" + (isRedirect ? attmtsRedir : attmts) + err.code,
|
||||||
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Probably main process exited
|
// Probably main process exited
|
||||||
}
|
}
|
||||||
|
@ -29,7 +31,8 @@ function serverErrorHandler(err, isRedirect, server, start) {
|
||||||
setTimeout(start, 900);
|
setTimeout(start, 900);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
if (cluster.isPrimary !== undefined) process.send("\x12ERRCRASH" + err.code);
|
if (cluster.isPrimary !== undefined)
|
||||||
|
process.send("\x12ERRCRASH" + err.code);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Probably main process exited
|
// Probably main process exited
|
||||||
}
|
}
|
||||||
|
@ -50,14 +53,18 @@ process.messageEventListeners.push((worker, serverconsole) => {
|
||||||
if (message.indexOf("\x12ERRLIST") == 0) {
|
if (message.indexOf("\x12ERRLIST") == 0) {
|
||||||
const tries = parseInt(msg.substring(8, 9));
|
const tries = parseInt(msg.substring(8, 9));
|
||||||
const errCode = msg.substring(9);
|
const errCode = msg.substring(9);
|
||||||
serverconsole.locerrmessage(serverErrorDescs[errCode] ? serverErrorDescs[errCode] : serverErrorDescs["UNKNOWN"]);
|
serverconsole.locerrmessage(
|
||||||
|
serverErrorDescs[errCode]
|
||||||
|
? serverErrorDescs[errCode]
|
||||||
|
: serverErrorDescs["UNKNOWN"],
|
||||||
|
);
|
||||||
serverconsole.locmessage(tries + " attempts left.");
|
serverconsole.locmessage(tries + " attempts left.");
|
||||||
}
|
}
|
||||||
if (message.length >= 9 && msg.indexOf("\x12ERRCRASH") == 0) {
|
if (message.length >= 9 && msg.indexOf("\x12ERRCRASH") == 0) {
|
||||||
const errno = errors[msg.substring(9)];
|
const errno = errors[msg.substring(9)];
|
||||||
process.exit(errno !== undefined ? errno : 1);
|
process.exit(errno !== undefined ? errno : 1);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = (serverconsoleO) => {
|
module.exports = (serverconsoleO) => {
|
||||||
|
|
Reference in a new issue