log bad lines before raising exception