]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Don't list warnings in console when module import fails 38/2738/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Thu, 28 Feb 2019 13:22:43 +0000 (15:22 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Thu, 28 Feb 2019 13:22:43 +0000 (15:22 +0200)
Change-Id: I54832d5c530f173665c632493403963dda80e2ea

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/commands/CommandSession.java

index 46cd0cb457d8a2567cfe90b5c13dff6bc55f0a2c..d0e44a9c7b263a36c0a75b60cc5f678432081165 100644 (file)
@@ -32,6 +32,7 @@ import org.simantics.scl.compiler.environment.Environment;
 import org.simantics.scl.compiler.environment.LocalEnvironment;
 import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification;
 import org.simantics.scl.compiler.errors.CompilationError;
+import org.simantics.scl.compiler.errors.ErrorSeverity;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.codegen.utils.NameMangling;
 import org.simantics.scl.compiler.internal.parsing.exceptions.SCLSyntaxErrorException;
@@ -123,7 +124,8 @@ public class CommandSession {
                     defaultHandler.printError(failure.toString());
                     if(failure.reason instanceof CompilationError[])
                         for(CompilationError error : (CompilationError[])failure.reason) {
-                            defaultHandler.printError("    " + error.description);
+                            if(error.severity != ErrorSeverity.WARNING)
+                                defaultHandler.printError("    " + error.description);
                         }
                 }
                 for(CommandSessionImportEntry entry : importEntries)
@@ -657,7 +659,7 @@ public class CommandSession {
             formatException(handler, e);
         }
     }
-    
+
     public static CompilationError[] validate(ModuleRepository moduleRepository,StringReader commandReader) {
         CommandSession session = new CommandSession(moduleRepository, null);
         return session.validate(commandReader);