throw(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 (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