1throw(n) Forward compatibility implementation of [throw] throw(n)
2
3
4
5______________________________________________________________________________
6
8 throw - throw - Throw an error exception with a message
9
11 package require Tcl 8.5
12
13 package require throw ?1?
14
15 ::throw error_code error_message
16
17______________________________________________________________________________
18
20 This package provides a forward-compatibility implementation of Tcl
21 8.6's throw command (TIP 329), for Tcl 8.5. The code was directly
22 pulled from Tcl 8.6 revision ?, when try/finally was implemented as Tcl
23 procedure instead of in C.
24
25 ::throw error_code error_message
26 throw is merely a reordering of the arguments of the error com‐
27 mand. It throws an error with the indicated error code and error
28 message.
29
31 throw {MYERROR CODE} "My error message"
32
33
35 This document, and the package it describes, will undoubtedly contain
36 bugs and other problems. Please report such in the category try of the
37 Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please also
38 report any ideas for enhancements you may have for either package
39 and/or documentation.
40
41 When proposing code changes, please provide unified diffs, i.e the out‐
42 put of diff -u.
43
44 Note further that attachments are strongly preferred over inlined
45 patches. Attachments can be made by going to the Edit form of the
46 ticket immediately after its creation, and then using the left-most
47 button in the secondary navigation bar.
48
50 error(n)
51
53 error, return, throw
54
56 Utility
57
59 Copyright (c) 2015 Miguel Martínez López, BSD licensed
60
61
62
63
64tcllib 1 throw(n)