Improved compilation error handling by using DiagnosticListener