Skip to content

Commit

Permalink
Make Build.strings raise user error
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Oct 30, 2019
1 parent 8bf5d25 commit 296b29e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dune/build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ let lines_of p = Lines_of p
let strings p =
let f x =
match Scanf.unescaped x with
| Error () -> Code_error.raise "Build.strings" []
| Error () ->
User_error.raise
[ Pp.textf "Unable to parse %s" (Path.to_string_maybe_quoted p)
; Pp.textf
"This file must be a list of lines escaped using OCaml's \
conventions"
]
| Ok s -> s
in
Map ((fun l -> List.map l ~f), lines_of p)
Expand Down

0 comments on commit 296b29e

Please sign in to comment.