Put main loop in try block.