diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index 7890828b2cd25..cfea0990356c6 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -568,7 +568,9 @@ private[spark] object Utils extends Logging { filename = Some(filename)) } } catch { - case e: Throwable => throw new IllegalStateException("Unable to fetch file %s into <%s> / <%s>".format(url, targetDir, filename)) + case NonFatal(e) => throw new IllegalStateException( + s"Unable to fetch file $url into $targetDir as $filename", + e) } }