I want my script to terminate if a certain execution could not be performed. Example: try { ftp.connect(); } catch (e) { console.log("There was an error with connecting " + e); process.exit; }
How about this:
function transferFiles() { try { ftp.connect(); } catch (e) { console.log("There was an error with connecting " + e); return; } } transferFiles();