Skip to content
Permalink
Browse files
Merge pull request #1205 from Pieter12345/master
Fix exception target for single include() exceptions
  • Loading branch information
PseudoKnight committed Jun 7, 2020
2 parents 5c503db + 47a242a commit 3661ebd7d42532f2a72730578fdcddbde4ebb6b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -1743,7 +1743,7 @@ public CVoid execs(Target t, Environment env, Script parent, ParseTree... nodes)
// Handle compile exceptions.
if(exceptions.size() == 1) {
ConfigCompileException ex = exceptions.iterator().next();
String fileName = (ex.getFile() == null ? "Unknown Source" : file.getName());
String fileName = (ex.getFile() == null ? "Unknown Source" : ex.getFile().getName());
throw new CREIncludeException(
"There was a compile error when trying to include the script at " + file
+ "\n" + ex.getMessage() + " :: " + fileName + ":" + ex.getLineNum(), t);
@@ -79,7 +79,7 @@ public static ParseTree get(File file, com.laytonsmith.core.environments.Environ
ANALYSIS_CACHE.put(file, staticAnalysis);
return tree;
} catch (ConfigCompileException ex) {
String fileName = (ex.getFile() == null ? "Unknown Source" : file.getName());
String fileName = (ex.getFile() == null ? "Unknown Source" : ex.getFile().getName());
throw new CREIncludeException("There was a compile error when trying to include the script at " + file
+ "\n" + ex.getMessage() + " :: " + fileName + ":" + ex.getLineNum(), t);
} catch (ConfigCompileGroupException exs) {

0 comments on commit 3661ebd

Please sign in to comment.