aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-04-12 10:03:40 +0100
committerMichael Williamson <mike@zwobble.org>2026-04-12 10:03:40 +0100
commit08522ea706b0e8b883a3cec97755e4e6dc562788 (patch)
tree884618500937285dc41f00841b2203b22a25d551
parent612eaf73eba92a633c4790db2e406eb0def2f6fe (diff)
Don't print null sources for errors
-rw-r--r--src/main/java/org/shedlang/compiler/cli/ShedCli.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/shedlang/compiler/cli/ShedCli.java b/src/main/java/org/shedlang/compiler/cli/ShedCli.java
index e4f98607..7f6d88ad 100644
--- a/src/main/java/org/shedlang/compiler/cli/ShedCli.java
+++ b/src/main/java/org/shedlang/compiler/cli/ShedCli.java
@@ -8,6 +8,7 @@ import org.shedlang.compiler.ShedCompiler;
import org.shedlang.compiler.backends.Backends;
import org.shedlang.compiler.backends.ShedTarget;
import org.shedlang.compiler.errors.CompilerError;
+import org.shedlang.compiler.sources.NullSource;
import java.io.IOException;
import java.nio.file.Path;
@@ -19,7 +20,9 @@ public class ShedCli {
try {
compile(args);
} catch (CompilerError error) {
- System.err.println(error.source().describe());
+ if (!(error.source() instanceof NullSource)) {
+ System.err.println(error.source().describe());
+ }
System.err.println(error.getMessage());
System.exit(2);
}