Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9 views
asked in CompleteFTP by (200 points)
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;
}

1 Answer

+1 vote
answered by (43.9k points)

How about this:

function transferFiles() {
    try {
        ftp.connect();
    } catch (e) {
        console.log("There was an error with connecting " + e);
        return;
    }
}

transferFiles();

Categories

...