Skip to content

Commit

Permalink
pkg: change wording for warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne Marais <[email protected]>
  • Loading branch information
maiste committed Jun 24, 2024
1 parent 4279490 commit 63c8b7b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/dune_rules/pkg_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,12 @@ module Run_with_path = struct
result
;;

let error_msg t error =
let error_msg ~is_critical t error =
let pp_pkg =
let pkg_name = Dune_pkg.Package_name.to_string (fst t.pkg) in
Pp.textf "Package %s fails to build" pkg_name
if is_critical
then Pp.textf "Package %s fails to build" pkg_name
else Pp.textf "Package %s prints some errors" pkg_name
in
let loc = snd t.pkg in
User_message.make ~loc [ pp_pkg; Pp.verbatim error ]
Expand All @@ -561,13 +563,13 @@ module Run_with_path = struct
let prerr ~rc t =
match Predicate.test t.accepted_exit_codes rc, t.display with
| false, _ ->
let msg = Stdune.Io.read_file t.filename |> error_msg t in
let msg = Stdune.Io.read_file t.filename |> error_msg ~is_critical:true t in
raise (User_error.E msg)
| true, Display.Verbose ->
let error = Stdune.Io.read_file t.filename in
if not (String.is_empty error)
then (
let msg = error_msg t error in
let msg = error_msg ~is_critical:false t error in
Console.print_user_message msg)
| true, _ -> ()
;;
Expand Down

0 comments on commit 63c8b7b

Please sign in to comment.