Forum Discussion
Russell_E_Glaue
Nimbostratus
Feb 16, 2009no such pool Failed Tcl_pool_GetFromObj
I am receiving this error message, and cannot determine why it is occurring. I cannot even use TCL 'catch' to catch the error.
Feb 16 13:22:48 tmm tmm[1568]: 01220001:3: TCL error: dist...
hoolio
Cirrostratus
Feb 17, 2009Hi RG,
The code within the catch statement is executed. Catch handles the error if one occurs and allows any subsequent code to be executed normally. So the example I posted above should work fine to try to assign the pool and otherwise log an error message if the pool doesn't exist. If you added more code after the catch statement, it would be run after the catch statement runs regardless of whether the code within the catch statement generated an error or not.
Here are a few examples of using catch:
iRule test:
return 0 is false. Save the result of running the command 'return 0' to the variable named result
if {[catch {return 0} result]}{
log local0. "catch was true, because return resulted in return code 0. Result: $result"
} else {
log local0. "catch was false, because return resulted in non-zero return code. Result: $result"
}
Log output:
Rule : catch was true, because return resulted in return code 0. Result: 0
iRule test:
if {[catch {set test 1} result] }{
log local0. "catch was true, because the set command returned with an error. Result: $result"
} else {
log local0. "catch was false, because the set command returned without error. Result: $result"
}
This log statement will run regardless of whether there is an error or not
log local0. "\$test: $test (This log statement will run regardless of whether there is an error or not)"
Log output:
Rule : catch was false, because the set command returned without error. Result: 1
Rule : $test: 1 (This log statement will run regardless of whether there is an error or not)
iRule test:
if {[catch {set test $var_that_doesnt_exist} result]}{
log local0. "catch was true, because the set command returned with an error. Result: $result "
} else {
log local0. "catch was false, because the set command returned without error. Result: $result"
}
Log output:
Rule : catch was true, because the set command returned with an error. Result: can't read "var_that_doesnt_exist": no such variable
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
