Okay actually this will work just fine as-is. `CommandUtils` checks for a non-zero exit code, and it throws a Spark exception if there is one.