Skip to content

Commit 64825f9

Browse files
committed
Add path for syntax errors
1 parent 6289100 commit 64825f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/jruby/prism/parser/ParserPrismBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private ParseResult parseInternal(String fileName, DynamicScope blockScope, byte
8181
if (res.errors != null && res.errors.length > 0) {
8282
int line = res.source.line(res.errors[0].location.startOffset);
8383

84-
throw runtime.newSyntaxError(fileName + ":" + line + ": " + res.errors[0].message);
84+
throw runtime.newSyntaxError(fileName + ":" + line + ": " + res.errors[0].message, fileName);
8585
}
8686

8787
if (type == MAIN && res.dataLocation != null) {
@@ -165,7 +165,7 @@ private byte[] loadFully(String fileName, InputStream in) {
165165
data.readFully(source);
166166
return source;
167167
} catch (IOException e) {
168-
throw runtime.newSyntaxError("Failed to read source file: " + fileName);
168+
throw runtime.newSyntaxError("Failed to read source file: " + fileName, fileName);
169169
}
170170
}
171171

0 commit comments

Comments
 (0)