Skip to content
Permalink
Browse files
Fix exception target for single include() exceptions
  • Loading branch information
Pieter12345 committed Jun 7, 2020
1 parent 5c503db commit 47a242a845bffddefd926c0f9d67e44095bdca25
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 47a242a

Please sign in to comment.