throw(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– 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 (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