[SPARK-4274] [SQL] Print informative message while logical plan analyzing failed in test

Oh, I didn't know this. Thank you @marmbrus very much for the code snippet.

After debugging, I think you are right, the exception is thrown by `${executedPlan.codegenEnabled}`, the `executedPlan` is null if something wrong in parsing or analyzing etc. I've updated the code again.