Skip to content

Commit caf5a99

Browse files
committed
use SparkException to warp exception
1 parent c02140f commit caf5a99

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ import org.apache.hadoop.yarn.api._
3535
import org.apache.hadoop.yarn.api.records._
3636
import org.apache.hadoop.yarn.client.api.NMClient
3737
import org.apache.hadoop.yarn.conf.YarnConfiguration
38-
import org.apache.hadoop.yarn.exceptions.YarnException
3938
import org.apache.hadoop.yarn.ipc.YarnRPC
4039
import org.apache.hadoop.yarn.util.{ConverterUtils, Records}
4140

42-
import org.apache.spark.{SecurityManager, SparkConf, Logging}
41+
import org.apache.spark.{SparkException, SecurityManager, SparkConf, Logging}
4342
import org.apache.spark.network.util.JavaUtils
4443

4544
class ExecutorRunnable(
@@ -113,10 +112,9 @@ class ExecutorRunnable(
113112
try {
114113
nmClient.startContainer(container, ctx)
115114
} catch {
116-
case ex: YarnException =>
117-
logError("Exception while start container %s on host %s:"
118-
.format(container.getId, hostname), ex)
119-
throw ex
115+
case ex: Exception =>
116+
throw new SparkException("Exception while starting container ${container.getId}" +
117+
" on host $hostname", ex)
120118
}
121119
}
122120

0 commit comments

Comments
 (0)