Unconditional non-fatal server start error logs

This commit is contained in:
Cohee 2024-08-16 11:21:58 +00:00
parent e707def7dd
commit 82e569cf08

View File

@ -787,17 +787,17 @@ function logSecurityAlert(message) {
*/
function handleServerListenFail(v6Failed, v4Failed) {
if (v6Failed && !enableIPv4) {
console.error('fatal error: Failed to start server on IPv6 and IPv4 disabled');
console.error(color.red('fatal error: Failed to start server on IPv6 and IPv4 disabled'));
process.exit(1);
}
if (v4Failed && !enableIPv6) {
console.error('fatal error: Failed to start server on IPv4 and IPv6 disabled');
console.error(color.red('fatal error: Failed to start server on IPv4 and IPv6 disabled'));
process.exit(1);
}
if (v6Failed && v4Failed) {
console.error('fatal error: Failed to start server on both IPv6 and IPv4');
console.error(color.red('fatal error: Failed to start server on both IPv6 and IPv4'));
process.exit(1);
}
}
@ -846,9 +846,7 @@ async function startHTTPorHTTPS() {
try {
await createFunc(tavernUrlV6);
} catch (error) {
if (enableIPv4) {
console.error('non-fatal error: failed to start server on IPv6', error);
}
console.error('non-fatal error: failed to start server on IPv6', error);
v6Failed = true;
}
@ -858,9 +856,7 @@ async function startHTTPorHTTPS() {
try {
await createFunc(tavernUrl);
} catch (error) {
if (enableIPv6) {
console.error('non-fatal error: failed to start server on IPv4', error);
}
console.error('non-fatal error: failed to start server on IPv4', error);
v4Failed = true;
}