Catch errors and print them