http://purl.org/tcl/home/man/tcl8.4/TclCmd/error.htm : '''error''' ''message'' ?''info''? ?''code''? Generates an error with the specified ''message''. If supplied, ''info'' is used to seed the [errorInfo] and ''code'' becomes the [errorCode] (which is otherwise `NONE`). <> [RS] In C, errors are something you loathe and try to avoid. In Tcl, they're like "little friends" - helpful (explaining the problem), not messing up everything (as a Segmentation Fault/Bus Error/Divide by Zero would do). For instance, set fp [open foo.bar] leads to the error couldn't open "foo.bar": no such file or directory which tells it pretty well, and does not terminate the application (if it has an [event loop] or is interactive). In C, you would have received a NULL pointer, and without checking that, Segmentation Fault would be right around the corner. So in C, you have to add checks for everything that might go wrong; in Tcl, you only need to treat errors if you can express it better than Tcl already does. And you can also play with errors: to fully break out of a multiply nested loop, put a [catch] outside and a ''throw'' within: catch { ...# deep nesting ... throw } There is no ''throw'' command in Tcl, so it is handled by [unknown], which tries to load it from [auto_index], and if that fails too, an error is raised - which in turn is caught by the [catch]. Pretty natural, no? And still somehow Zen buddhistic, if you deliberately use a non-existing command, and it does just the right thing... ([Kevin Kenny] introduced this trick in [Tricky catch]). In some cases, stack traces look better (one less layer) if you replace error "Something went wrong" with return -code error "Something went wrong" ---- [An error experiment] ---- [DKF]: If you're looking to figure out what went wrong when you hit an unexpected error, there is a page [documenting Tcl's warning/error messages] though the info there is incomplete and subject to change at short notice. Still, anything is better than nothing. :-) <> ---- =_Part_495907_906211547.1424961850526" ------=_Part_495907_906211547.1424961850526 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ------=_Part_495907_906211547.1424961850526 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

------=_Part_495907_906211547.1424961850526-- ------=_Part_495908_1319536335.1424961850527 Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=C360_2014-10-04-12-13-25-955.jpg Content-ID: <378c6196-da77-53c3-7dce-645b3a23ba16@yahoo.com> /9j/4AAQSkZJRgABAQAAAQABAAD/4QPYRXhpZgAASUkqAA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