[generators] more verbose error reports

if someone actually manages to provide a directory instead of a xml file
This commit is contained in:
Felix Ruess
2016-04-06 11:26:18 +02:00
parent e69f68cb1d
commit e18e4e2f29
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -237,6 +237,7 @@ let my_xml_parse_file =
let parse_file = fun ?(noprovedtd = false) file ->
try (if noprovedtd then my_xml_parse_file else Xml.parse_file) file
with
| Sys_error e -> failwith (sprintf "Error loading xml file %s: %s" file e)
| Xml.Error e -> failwith (sprintf "XML error in %s: %s" file (Xml.error e))
| Xml.File_not_found f -> failwith (sprintf "File not found: %s" f)
| Dtd.Prove_error e -> failwith (sprintf "DTD prove error in %s: %s" file (Dtd.prove_error e))
+1 -1
View File
@@ -346,7 +346,7 @@ let () =
mkdir (aircraft_conf_dir // "telemetry");
let target = try Sys.getenv "TARGET" with _ -> "" in
let modules = Gen_common.get_modules_of_config ~target (ExtXml.parse_file abs_airframe_file) (Xml.parse_file abs_flight_plan_file) in
let modules = Gen_common.get_modules_of_config ~target (ExtXml.parse_file abs_airframe_file) (ExtXml.parse_file abs_flight_plan_file) in
(* normal settings *)
let settings = try Env.filter_settings (value "settings") with _ -> "" in
(* remove settings if not supported for the current target *)