Fix: dep exe download err

This commit is contained in:
unitwk 2022-11-29 19:11:45 +08:00
parent 5839c1566f
commit bdeaad46bd
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ function installPtyForLinux(url: string) {
const file = fs.createWriteStream(PTY_PATH);
https.get(url, (res) => {
if (res.statusCode !== 200) {
return reject(new Error("code!=200"));
return reject(new Error(`Try download: ${url} failed.`));
}
res.on("error", (err) => {
if (fs.existsSync(PTY_PATH)) fs.removeSync(PTY_PATH);

View File

@ -60,7 +60,7 @@ export function navigation(socket: Socket) {
}
// Register all events with Socket
for (const event of routerApp.eventNames()) {
socket.on(event, (protocol: IPacket) => {
socket.on(event as string, (protocol: IPacket) => {
if (!protocol) return logger.info(`session ${socket.id} request data protocol format is incorrect`);
const ctx = new RouterContext(protocol.uuid, socket, session, event.toString());
routerApp.emitRouter(event as string, ctx, protocol.data);