diff options
Diffstat (limited to 'doc/error.n')
-rw-r--r-- | doc/error.n | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/doc/error.n b/doc/error.n index d61bd7b..77391e5 100644 --- a/doc/error.n +++ b/doc/error.n @@ -37,21 +37,18 @@ with the \fBcatch\fR command: if a caught error cannot be handled successfully, \fIinfo\fR can be used to return a stack trace reflecting the original point of occurrence of the error: -.PP .CS -catch {...} errMsg +\fBcatch {...} errMsg set savedInfo $::errorInfo \&... -\fBerror\fR $errMsg $savedInfo +error $errMsg $savedInfo\fR .CE -.PP When working with Tcl 8.5 or later, the following code should be used instead: -.PP .CS -catch {...} errMsg options +\fBcatch {...} errMsg options \&... -return -options $options $errMsg +return -options $options $errMsg\fR .CE .PP If the \fIcode\fR argument is present, then its value is stored @@ -61,18 +58,15 @@ of the error in cases where such information is available; see the \fBreturn\fR manual page for information on the proper format for this option's value. .SH EXAMPLE -.PP Generate an error if a basic mathematical operation fails: -.PP .CS if {1+2 != 3} { \fBerror\fR "something is very wrong with addition" } .CE + .SH "SEE ALSO" catch(n), return(n) + .SH KEYWORDS -error, exception -'\" Local Variables: -'\" mode: nroff -'\" End: +error |