Content-type: text/html
panicTrap
Panic
panicTrapThese VarName
When installed (by package require panicTrap) a call is made to replace the Tcl panic code with a routine in this package. When a panic occures this code attempts to produce a diagnostic output to stdout. followed by an abort. (If the Tcl library is sufficiently lost/broken these efforts may fail.)
panicTrap
Outputs the information as if a panic occured at the place invoked. Use this to verify the setup with out causing a real panic/abort.
Panic
Calls panic at the current location. For testing or, possibly, a real panic is desired. Produces the same output as panicTrap (tailored to the current state) followed by an abort.
panicTrapThese VarName
VarName should be the name of a list of VarNames. When a panic occures the value of each VarName in VarNames will be added to the panic information sent to stdout. Neither VarName nor the list it references need to be defined when panicTrapThese is invoked. The list it refers to may be altered as the program progress to cause any panic to dump different and/or additional information. The list of VarNames may be as long as desired/needed.
# Load the 'panic trap' code right now.. lappend ::auto_path [file dir [file norm [info script]]]/packages package require panicTrap
# Load the 'panic trap' code right now.. lappend ::auto_path [file dir [file norm [info script]]]/packages package require panicTrap panicTrapThese foo set foo [list varName1 varName2]
Copyright (C) 2023 Tom Turkey
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.