# Create a thread pool and post a job that throws an error.
package require Thread
set tpool [tpool::create]
set job [tpool::post $tpool {error 123}]

# Get the result.
tpool::wait $tpool $job
catch {tpool::get $tpool $job} result
puts "result = $result"
puts "errorInfo = $errorInfo" ;# BUG: Result displayed twice
puts "errorCode = $errorCode"

# Wait for pool to terminate, otherwise receive error:
# "called Tcl_FindHashEntry on deleted table".
tpool::release $tpool
after 1 {set forever 1}
vwait forever


# Output:
#
# result = 123
# errorInfo = 123123
#     while executing
# "error 123"
#     invoked from within
# "tpool::get $tpool $job"
# errorCode = NONE
