Fix a handful of errors and warnings I've seen. Gets further running in docker, now.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3773 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-17 21:46:32 +00:00
parent e9e1a3e80d
commit c864041fa0
5 changed files with 11 additions and 5 deletions

View File

@ -60,7 +60,6 @@ function socket(request, response, client) {
blobId = await new Database(user).get('path:' + path);
if (!blobId) {
response.send(JSON.stringify({action: "error", error: message.path + ' not found'}), 0x1);
request.close();
}
}
response.send(JSON.stringify({action: "session", credentials: credentials}), 0x1);

View File

@ -422,7 +422,11 @@ function receive(message) {
} else if (message && message.action == "ping") {
gSocket.send(JSON.stringify({action: "pong"}));
} else if (message && message.action == "error") {
setStatusMessage(message.error.message + '\n' + message.error.stack, '#f00', false);
if (typeof(message.error) == 'string') {
setStatusMessage(message.error, '#f00', false);
} else {
setStatusMessage(message.error.message + '\n' + message.error.stack, '#f00', false);
}
console.log(message.error);
}
}

View File

@ -546,7 +546,7 @@ async function loadSettings() {
gGlobalSettings = JSON.parse(data);
}
} catch (error) {
print("Error loading settings from " + kGlobalSettingsFile + ": " + error);
print("Error loading settings from " + kGlobalSettingsFile + ":", error);
}
}