Parcourir la source

Catch hxml file not found errors

Rudy Ges il y a 5 mois
Parent
commit
274f4f859c
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/compiler/compiler.ml

+ 1 - 1
src/compiler/compiler.ml

@@ -663,7 +663,7 @@ module HighLevel = struct
 			| arg :: l ->
 				match List.rev (ExtString.String.nsplit arg ".") with
 				| "hxml" :: _ :: _ when (match acc with "-cmd" :: _ | "--cmd" :: _ -> false | _ -> true) ->
-					let full_path = Extc.get_full_path arg in
+					let full_path = try Extc.get_full_path arg with Failure(_) -> raise (Arg.Bad (Printf.sprintf "File not found: %s" arg)) in
 					if List.mem full_path !hxml_stack then
 						raise (Arg.Bad (Printf.sprintf "Duplicate hxml inclusion: %s" full_path))
 					else