Skip to content

Commit

Permalink
node_trans_session: Use try/catch when cleaning up files
Browse files Browse the repository at this point in the history
  • Loading branch information
datagutt committed Nov 7, 2019
1 parent f2a52d9 commit 37887cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions node_trans_session.js
Expand Up @@ -103,13 +103,17 @@ class NodeTransSession extends EventEmitter {
filename.endsWith('.flv') ||
filename.endsWith('.png') ||
filename.endsWith('.tmp')) {
fs.unlinkSync(ouPath + '/' + filename);
try {
fs.unlinkSync(ouPath + '/' + filename);
} catch (e) {}
}
})
}
});
if (this.conf.hls) {
fs.writeFileSync(ouPath + '/' + this.hlsFileName, '#EXTM3U\n');
try {
fs.writeFileSync(ouPath + '/' + this.hlsFileName, '#EXTM3U\n');
} catch(e) {}
}
});
}
Expand Down

0 comments on commit 37887cc

Please sign in to comment.