Fixed server exception.

Ylian Saint-Hilaire committed Mar 1, 2021 at 12:38 UTC ce44fcb2ebc590534400e64bb48b170e5ec7ffe0
1 file changed +3 -3
webserver.js
+3 -3
@@ -3989,7 +3989,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
3989 // Perform an async file open
3990 var callback = function onFileOpen(err, fd) {
3991 onFileOpen.xws.xfile = fd;
3992 - onFileOpen.xws.send(JSON.stringify({ action: 'download', sub: 'startack', id: onFileOpen.xws.xid, ack: 1 })); // Ask for a directory (test)
3992 + try { onFileOpen.xws.send(JSON.stringify({ action: 'download', sub: 'startack', id: onFileOpen.xws.xid, ack: 1 })); } catch (ex) { } // Ask for a directory (test)
3993 };
3994 callback.xws = this;
3995 obj.fs.open(this.xfilepath + '.part', 'w', callback);
@@ -4013,11 +4013,11 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
4013 obj.fs.rename(onFileDataWritten.xws.xfilepath + '.part', onFileDataWritten.xws.xfilepath, function (err) { });
4014 onFileDataWritten.xws.xfile = null;
4015 }
4016 - onFileDataWritten.xws.send(JSON.stringify({ action: 'markcoredump' })); // Ask to delete the core dump file
4016 + try { onFileDataWritten.xws.send(JSON.stringify({ action: 'markcoredump' })); } catch (ex) { } // Ask to delete the core dump file
4017 try { onFileDataWritten.xws.close(); } catch (ex) { }
4018 } else {
4019 // Send ack
4020 - onFileDataWritten.xws.send(JSON.stringify({ action: 'download', sub: 'ack', id: onFileDataWritten.xws.xid })); // Ask for a directory (test)
4020 + try { onFileDataWritten.xws.send(JSON.stringify({ action: 'download', sub: 'ack', id: onFileDataWritten.xws.xid })); } catch (ex) { } // Ask for a directory (test)
4021 }
4022 };
4023 callback.xws = this;