private void reportThriftException()

in thrifty-gradle-plugin/src/main/java/com/microsoft/thrifty/gradle/GenerateThriftSourcesWorkAction.java [104:126]


    private void reportThriftException(LoadFailedException e) {
        for (ErrorReporter.Report report : e.getErrorReporter().getReports()) {
            String template = "{}: {}";
            switch (report.getLevel()) {
                case WARNING:
                    LOGGER.warn(template, report.getLocation(), report.getMessage());
                    break;
                case ERROR:
                    LOGGER.error(template, report.getLocation(), report.getMessage());
                    break;
                default:
                    throw new IllegalStateException("Unexpected report level: " + report.getLevel());
            }
        }

        ShowStacktrace sst = getParameters().getShowStacktrace().getOrElse(ShowStacktrace.INTERNAL_EXCEPTIONS);
        switch (sst) {
            case ALWAYS:
            case ALWAYS_FULL:
                LOGGER.error("Thrift compilation failed", e);
                break;
        }
    }