SPARK-3014. Log a more informative messages in a couple failure scenario...

...s
won't this throw an NPE if `sparkContext == null`? Maybe we should put this whole block in an else case.