Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
276 views
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
by (51.6k points)

How about this:

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

transferFiles();

Categories

...