Error Checking sftp results

Advertisement

GiermoIVI
Guest

Error Checking sftp results

Hello
I have a script that will download data from a remote server. The script works fine, i just want to run some test cases to ensure that emails are sent when file downloads fail.

What is the easiest way to create this test case? I have try and catch etc in the code already

I ask, as i started downloading a large file , then janked out the network cable to attempt to cause the download to fail.

The program never comes out of the download process(powershell script), it just hangs there and i have to force close the script.

worst comes to worst, i cna search for .filepart showing something happened.

But id rather do this properly, and have a test case prove the code works, and not just blindly trust the try / catch

thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Error Checking sftp results

GiermoIVI wrote:

The program never comes out of the download process(powershell script), it just hangs there and i have to force close the script.
Isn't it running in reconnection loop?
See option reconnecttime:
https://winscp.net/eng/docs/scriptcommand_option

Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

Reply with quote

Advertisement

You can post new topics in this forum