If I purposely mispell the file name, it should fail – and I do get the error messages written to stdout (which is annoying and someday I’ll figure out how to intercept it) – but the [catch ..] does not work.
Am I using [catch..] wrong?
if {$debug} {echo “[gts] $module FTP CD to dir $dir successful”}
# ftp get requested file
set result “”
if {[catch {::ftp::Get $handle $file -variable content} result]} {
if {$debug} {echo “[gts] $module FTP Get result $result”}
::ftp::Close $handle
if {$debug} {echo “[gts] $module failed to complete FTP Get of file $file”}
return “-1failed to complete FTP Get of file $file”
}
if {$debug} {echo “[gts] $module FTP get file $file data successful”}
I’m getting the ‘successful’ debugging statement but I’m not getting the ‘error’ debugging statement.
12/04/18 15:42:29.023 html_admission_notification.get_ftp_data FTP CD to dir PCPNotify successful
error error | E: Error retrieving file “AdmissionN_otification.html”!:
error invalid command name “tix”
error while executing
error “tix option get fixed_font”
12/04/18 15:42:29.025 html_admission_notification.get_ftp_data FTP get file AdmissionN_otification.html data successful
If I try again with the correct file name, it works (I can see the content):
12/04/18 15:47:09.537 html_admission_notification.get_ftp_data FTP CD to dir PCPNotify successful
12/04/18 15:47:09.736 html_admission_notification.get_ftp_data FTP get file AdmissionNotification.html data successful
Or can someone suggest a way for me to detect the FTP runtime error in my code?
Peter
Peter Heggie
PeterHeggie@crouse.org