Forum Discussion
Bret_McGinnis_1
Nimbostratus
Sep 20, 2005TCL runtime errors
Hi, is there a way to capture and process iRule TCL runtime errors. On a few occasions I have created and tested an iRule and in our lab and it works fine. When I implement the iRule on a production B...
unRuleY_95363
Sep 30, 2005Historic F5 Account
The mod 12 calculation works fine up until the number is larger than 9 digits. After 9 it fails the integer check. -strict has no effect.Hmm, I'm not sure what's going on here other than Tcl may not be properly handling mod on what it calls "wide integers" (64-bit integers). I'll try to look into it. In the meantime, you could try using the binary command to break the "wide integer" into two regular 32-bit integers and then do the appropriate math on the combination of those.
As for the catch with a return in it: catch returns several values. From the Tcl documentation on sourceforge: Tcl also defines four exceptional return codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE).So, if you are using a return, the catch is likely returning a value of 2 instead of 0. You should be able to modify the if check around the catch to more specifically look for a value of 1 to mean an error occurred instead of != 0.
Last, the [LB::server addr] is actually a command not a variable. Therefore you can't use "info exists" on it. It will return an empty string if a server was not picked (eg: the pool had no nodes available).
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects