Javascript: Error in FTP access
The following is a routine to download content of a file.
Code:
var req = new XMLHttpRequest();
req.open( 'GET', 'ftp://username:[email protected]/index.html', true );
req.onreadystatechange = function() {
if( req.readyState == 4 ) {
print( req.responseText );
}
}
req.send( null );
It works fine except for the error handling. When login info is incorrect the following generic javascript window pops up.
Code:
530 Login Incorrect
When the file does not exits, it will pop up the following.
Code:
550/index.html No such file or directory
What I want to do is to suppress the generic error window and its message with my own. So how do I capture the type of error (error 530, 550, etc), and how do I prevent the generic javascript erro window from popping up?