Clearer error message

@gaurave

Small step towards improving the user experience from #2593.
Nice.

Can you throw a `SparkException` here and define an errorCode and `errorMsg`. What I am trying to do is, at the top level we only catch `SparkException` as they are known and leave the rest as `uncaught` ones.