Skip to content

Commit 75e3601

Browse files
committed
add error reporting
1 parent 8feab6f commit 75e3601

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ VLCPort = 9090
2828
[Other]
2929
# Milliseconds between checking console.log and VLC Media Player's status, recommended values range from 100 to 1000
3030
# Values above 1000 will be clamped to prevent issues with communicating to VLC
31-
RefreshMilliseconds = 200
31+
RefreshMilliseconds = 400

main.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ async function readNewLines() {
9999
const streamData = await readStreamAsText(conLogFileHandle.readable, "utf-8");
100100
fileSize += streamData.size;
101101
const lines = streamData.text.split(config.TF2.LinuxLineEndings ? "\n" : "\r\n");
102+
getCVARAsBool("sv_alltalk").then((isAlltalk) => {
103+
isAlltalkEnabled = isAlltalk;
104+
}).catch(() => {
105+
isAlltalkEnabled = false;
106+
});
102107
if (streamData.size === 0) {
103108
return;
104109
}
@@ -108,7 +113,6 @@ async function readNewLines() {
108113
}
109114
for (let i = 0; i < lines.length; i++) {
110115
if (lines[i].startsWith("(Demo Support) Start recording demos",)) {
111-
isAlltalkEnabled = await getCVARAsBool("sv_alltalk");
112116
/*TF2 has a bug where if you disconnect while using the voice chat the client will think it's still speaking
113117
fixing this using +voicerecord;-voicerecord when joining*/
114118
sendTF2Command("+voicerecord;-voicerecord");
@@ -210,7 +214,12 @@ async function checkMetaData() {
210214
try {
211215
response = await fetch(`http://:${VLCPassword}@127.0.0.1:${config.VLC.VLCPort}/requests/status.xml${nextCommand}`);
212216
} catch (e) {
213-
return false;
217+
// Occurs when it's been too long since the last fetch... ???
218+
if (e.message.includes("An existing connection was forcibly closed by the remote host.")) {
219+
return false;
220+
} else {
221+
throw e;
222+
}
214223
} finally {
215224
VLCCommandQueue.shift();
216225
}

0 commit comments

Comments
 (0)