thread-terminate should set an exception in the thread