void (boolean aborted, int errors, int warnings, @NotNull CompileContext compileContext) { if (errors > 0) { CompilerMessage[] errorMessages = compileContext.getMessages(CompilerMessageCategory.ERROR); StringBuilder errorMessage = new StringBuilder("Errors happened during build: " + errors); for (CompilerMessage error : errorMessages) { errorMessage.append("\n").append(error); } context.message(errorMessage.toString(), getLine()); spanRef.get().setAttribute("Errors", errors); } if (warnings > 0) { CompilerMessage[] warningMessages = compileContext.getMessages(CompilerMessageCategory.WARNING); StringBuilder warningMessage = new StringBuilder("Warnings happened during build: " + warnings); for (CompilerMessage warning : warningMessages) { warningMessage.append("\n").append(warning); } context.message(warningMessage.toString(), getLine()); spanRef.get().setAttribute("Warnings", warnings); } connection.disconnect(); }