Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting the error code

Status
Not open for further replies.

adekunleadekoya

Programmer
May 19, 2008
30

How do i get the error code and error message associated with a catch block like the one below? Assuming the remote machine is never existing

/**********************************
catch {
set s [socket 192.168.0.200 1110]
}
************************************/
 
Code:
set cs {set s [socket 192.168.0.200 1110]}
set rc [catch $cs em]
Now $rc will be the error code (1), and $em will be the error message (couldn't open socket: connection timed out)

_________________
Bob Rashkin
 
tanks it works like charm. my app is geting more robust.
love u all for giving me d tcl-specifics. i hav been able to focus on solving d real problem while learning a new language.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top