also log errors when they are thrown