Browse Source

[compiler] improve error message when hl_version is missing

closes #11086
Simon Krajewski 2 years ago
parent
commit
f6281c2da0
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/compiler/compiler.ml

+ 8 - 1
src/compiler/compiler.ml

@@ -138,7 +138,14 @@ module Setup = struct
 				"python"
 				"python"
 			| Hl ->
 			| Hl ->
 				add_std "hl";
 				add_std "hl";
-				if not (Common.defined com Define.HlVer) then Define.define_value com.defines Define.HlVer (try Std.input_file (Common.find_file com "hl/hl_version") with Not_found -> die "" __LOC__);
+				if not (Common.defined com Define.HlVer) then begin
+					let hl_ver = try
+						Std.input_file (Common.find_file com "hl/hl_version")
+					with Not_found ->
+						failwith "The file hl_version could not be found. Please make sure HAXE_STD_PATH is set to the standard library corresponding to the used compiler version."
+					in
+					Define.define_value com.defines Define.HlVer hl_ver
+				end;
 				"hl"
 				"hl"
 			| Eval ->
 			| Eval ->
 				add_std "eval";
 				add_std "eval";