mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-19 23:01:31 +02:00
adding error handling incase the config logging option is not defined
This commit is contained in:
@@ -20,10 +20,14 @@ module.exports = {
|
||||
getLogOptions: function() {
|
||||
var options = {};
|
||||
|
||||
if ('stream' in config.log.options) {
|
||||
options = {
|
||||
stream: fs.createWriteStream(process.cwd() + '/' + config.log.options.stream, {flags: 'a'})
|
||||
};
|
||||
try {
|
||||
if ('stream' in config.log.options) {
|
||||
options = {
|
||||
stream: fs.createWriteStream(process.cwd() + '/' + config.log.options.stream, {flags: 'a'})
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
return options;
|
||||
|
||||
Reference in New Issue
Block a user