Nest print thread into a try block