Print error messages for debugging.