Catch exceptions and print them