Skip to content

Commit

Permalink
♻️ Refactor(Mapping-test): Handle Spark exception messages instead of…
Browse files Browse the repository at this point in the history
… throwing directly
  • Loading branch information
camemre49 committed Feb 6, 2025
1 parent 1af283a commit ddaad53
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import io.tofhir.server.repository.schema.ISchemaRepository
import io.tofhir.server.util.DataFrameUtil
import org.apache.commons.io
import org.apache.kafka.common.errors.UnknownTopicOrPartitionException
import org.apache.spark.SparkException
import org.apache.spark.sql.KeyValueGroupedDataset
import org.json4s.jackson.JsonMethods
import org.json4s.{JArray, JBool, JObject, JString, JValue}
Expand Down Expand Up @@ -252,6 +253,11 @@ class ExecutionService(jobRepository: IJobRepository, mappingRepository: IMappin
case _ =>
throw ee
}
case se: SparkException =>
throw BadRequest(
"Invalid Source File",
se.getCause.getMessage.replace("\n", " "), Some(se)
)
case e: Exception =>
throw e
}
Expand Down

0 comments on commit ddaad53

Please sign in to comment.