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

...s
I just realized, even in the old code it's bound to throw an NPE if `sparkContext == null`, because we access it in L236 of the old code.