Catch exceptions during line checking.