diff options
-rw-r--r-- | ocamlbuild/configuration.ml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ocamlbuild/configuration.ml b/ocamlbuild/configuration.ml index 23e95963e..7a4f2f4fb 100644 --- a/ocamlbuild/configuration.ml +++ b/ocamlbuild/configuration.ml @@ -36,10 +36,12 @@ let parse_string s = add_config conf let parse_file ?dir file = - with_input_file file begin fun ic -> - let conf = Lexers.conf_lines dir 1 (Printf.sprintf "file: %S" file) (Lexing.from_channel ic) in - add_config conf - end + try + with_input_file file begin fun ic -> + let conf = Lexers.conf_lines dir 1 (Printf.sprintf "file: %S" file) (Lexing.from_channel ic) in + add_config conf + end + with Lexers.Error msg -> raise (Lexers.Error (file ^ ": " ^ msg)) let key_match = Glob.eval |