We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98dac2d commit d138c42Copy full SHA for d138c42
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/PythonParserImpl.java
@@ -258,6 +258,8 @@ public String unescapeJavaString(String str) {
258
259
private static PException handleParserError(ParserErrorCallback errors, Source source, Exception e) {
260
SourceSection section = PythonErrorStrategy.getPosition(source, e);
261
- throw errors.raiseInvalidSyntax(source, section);
+ // from parser we are getting RuntimeExceptions
262
+ String message = e instanceof RuntimeException && e.getMessage() != null ? e.getMessage() : "invalid syntax";
263
+ throw errors.raiseInvalidSyntax(source, section, message);
264
}
265
0 commit comments