better error diagnostics. Relates to IDEA-105726 (Compilation ends with some unspecified error)