You should use the built-in line separator. The gain is always that you won't have to problem what technique you code is functioning on, it will just do the job. Since Java 1.7Your next example will reset the exception's stack trace. The main most precisely preserves the origins on the exception.The output on the rethrow scenario reveals why It is