Log error in the right place, handle gracefully.