throw(n)
π throw(n) π
okay bestie, welcome to the throw page β it's the forward-compatibility implementation of [throw] and it's literally the shortest little glow-up of a command you'll ever meet. the manual name is throw and yes, we're doing this. π¦
β¨ NAME β¨
throw β throw an error exception with a message. that's it. that's the whole job. no cap. π
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require throw ?1.1?
::throw error_code error_message
π DESCRIPTION π
so here's the tea, bestie β β this package gives you a forward-compatibility implementation of Tcl 8.6's throw command (that's TIP 329, iykyk), and it's built for Tcl 8.5. the code was directly pulled from Tcl 8.6 revision ?, back when try/finally was implemented as a Tcl procedure instead of in C. iconic behavior honestly. π
π«Ά ::throw error_code error_message
ngl, throw is merely a reordering of the arguments of the error command. that's the whole plot twist. it throws an error with the indicated error code and error message. lowkey elegant, highkey slay. β¨
π EXAMPLES π
throw {MYERROR CODE} "My error message"
look at her go π
π BUGS, IDEAS, FEEDBACK π
not me having to tell you this, but: this document, and the package it describes, will undoubtedly contain bugs and other problems. π (yes, it says that fr fr, it's not just me being dramatic.)
please report such in the category try of the Tcllib Trackers at:
http://core.tcl.tk/tcllib/reportlist
please also report any ideas for enhancements you may have for either the package and/or the documentation. we want the ideas bestie, give us the ideas. π«Ά
when proposing code changes, please provide unified diffs, i.e the output of diff -u. periodt.
also note: attachments are strongly preferred over inlined patches. you can 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. yes, that button. the left-most one. π
π SEE ALSO π
β KEYWORDS β
error, return, throw
π§ CATEGORY π§
Utility
π COPYRIGHT π
Copyright (c) 2015 Miguel MartΓnez LΓ³pez, BSD licensed
okay that's the whole page bestie, you ate it πβ¨ this was tcllib, version 1.1, and the page is throw(n) β mwah, go throw some errors responsibly π
π
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- 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