login about faq

While the Chilkat FTP2 documentation (under DebugLogFilePath) suggests crashes are rare, they do happen. I have been having a problem with an FTP server closing the connection in the middle of transferring 16,000 files. When this happens, FTP2 pops up a message box with a lot of useful details.

But when the box pops up, it stops all processing until it is closed manually. I want to be able to use a try-catch block to trap the exception. Something like:

bool success; try { success = ftp.PutFile(localFile, remoteFile); } catch (Exception ex) { // Log ex.Message and exit }

but the catch block is never executed.

Is there some way to (1) trap the exception that occurs when "socket is not ready for writing" is reported, (2) turn off the pop-up messages, or (3) simply have FTP2 return false?

asked Oct 11 '12 at 22:38

T%20S%20Kelso's gravatar image

T S Kelso

1) The Chilkat methods never raise exceptions. The reason is that the Chilkat API is offered across many different programming languages, and in many cases there is no support for "try" ... "catch" exception handling. If a Chilkat method fails, it is indicated by a return value of False / 0 / Null, etc.

2) The Chilkat API's never pop-up messages. If a pop-up is happening, it is your own application code that is displaying the pop-up, not Chilkat.

3) As I mentioned in #1, a method indicates failure via the return value. For the PutFile method, it will return false to indicate failure.


answered Oct 12 '12 at 00:59

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Oct 11 '12 at 22:38

Seen: 1,539 times

Last updated: Oct 12 '12 at 00:59

powered by OSQA