]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/TextualModuleSource.java
(refs #7250) CHR bugfixes, cleaning up unit tests
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / source / TextualModuleSource.java
index 9a6f4c97fb07c33689e21885a1a641d4bdcadf01..3aa3f4281380dad972b26a98b1098264602b8656 100644 (file)
@@ -93,11 +93,14 @@ public abstract class TextualModuleSource implements ModuleSource {
             if(compiler.getErrorLog().hasNoErrors())
                 return new Success<Module>(compiler.getModule());
             else {
-                LOGGER.error("While compiling " + getModuleName() + ":");
-                LOGGER.error(CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors()));
+                if(!options.silent)
+                    LOGGER.error("While compiling " + getModuleName() + ":\n    " +
+                            CompilationErrorFormatter.toString(getSourceReader(null), compiler.getErrorLog().getErrors()).replaceAll("\n", "\n    "));
                 return new Failure(compiler.getErrorLog().getErrors());
             }
         } catch (IOException e) {
+            if(!options.silent)
+                LOGGER.error("Compilation of module " + moduleName + " failed.", e);
             return new Failure(e);
         }
     }