throw(3tcl)
β¨ NAME β¨
okay bestie, welcome to throw β the little command that throws an error exception with a message. yes that's literally the whole name line, it's giving "I contain multitudes but also I'm one job" π
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require throw ?1.1?
::throw error_code error_message
π DESCRIPTION π
So here's the tea π« β this package is a forward-compatibility implementation of Tcl 8.6's throw command (that's TIP 329 for the girlies keeping track), and it exists so that Tcl 8.5 can have it too. Because 8.5 girlies deserve nice things, no cap.
The code? directly pulled from Tcl 8.6 revision ?, from back when try/finally was implemented as a Tcl procedure instead of in C. history! we love a throwback β¨
π ::throw error_code error_message
okay so listen β throw is merely a reordering of the arguments of the error command. that's it. that's the whole thing. it throws an error with the indicated error code and error message, but the args go in the other order so it reads cute. icon behavior, honestly π
π¦ EXAMPLES π¦
look at her go:
throw {MYERROR CODE} "My error message"
ate. no crumbs. π
π BUGS, IDEAS, FEEDBACK π
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's giving "we're all just doing our best" π. please report such in the category try of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. and bestie β if you have any ideas for enhancements for either the package and/or the documentation, please also report those, we want them fr fr π«Ά
when proposing code changes, please provide unified diffs, i.e. the output of diff -u. this is not optional, it's the vibe check π
also note further: attachments are strongly preferred over inlined patches. you make an attachment by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. that's the secret handshake, iykyk π€«
π SEE ALSO π
π KEYWORDS π
error, return, throw β that's the whole mood board β¨
π CATEGORY π
Utility β she's practical, she's useful, she's booked and busy π
π COPYRIGHT π
Copyright (c) 2015 Miguel MartΓnez LΓ³pez, BSD licensed.
and that's the whole page, bestie!! this was throw(3tcl) from tcllib 1.1 β version 1.1, that's the one, periodt π
π¦ mwah, go throw some errors responsibly, ily π«Άπ
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2015 Miguel MartΓnez LΓ³pez, BSD licensed
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms