Skip to content

Commit

Permalink
use SparkException to warp exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lianhuiwang committed Feb 12, 2015
1 parent c02140f commit caf5a99
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ import org.apache.hadoop.yarn.api._
import org.apache.hadoop.yarn.api.records._
import org.apache.hadoop.yarn.client.api.NMClient
import org.apache.hadoop.yarn.conf.YarnConfiguration
import org.apache.hadoop.yarn.exceptions.YarnException
import org.apache.hadoop.yarn.ipc.YarnRPC
import org.apache.hadoop.yarn.util.{ConverterUtils, Records}

import org.apache.spark.{SecurityManager, SparkConf, Logging}
import org.apache.spark.{SparkException, SecurityManager, SparkConf, Logging}
import org.apache.spark.network.util.JavaUtils

class ExecutorRunnable(
Expand Down Expand Up @@ -113,10 +112,9 @@ class ExecutorRunnable(
try {
nmClient.startContainer(container, ctx)
} catch {
case ex: YarnException =>
logError("Exception while start container %s on host %s:"
.format(container.getId, hostname), ex)
throw ex
case ex: Exception =>
throw new SparkException("Exception while starting container ${container.getId}" +
" on host $hostname", ex)
}
}

Expand Down

0 comments on commit caf5a99

Please sign in to comment.