We can move this method to a util file and call it something like "toSparkException" or "wrapSparkException" ?