Skip to content
Snippets Groups Projects
Commit f57b35e8 authored by Michele Alberti's avatar Michele Alberti
Browse files

Rework some user error messages.

parent e9e4bb83
No related merge requests found
...@@ -150,7 +150,7 @@ let verify_json ?memlimit ?timelimit ?outfile json = ...@@ -150,7 +150,7 @@ let verify_json ?memlimit ?timelimit ?outfile json =
match query.output_file with match query.output_file with
| None -> | None ->
Logging.code_error ~src:Logs.default (fun m -> Logging.code_error ~src:Logs.default (fun m ->
m "No output file found to record verification results") m "No output file specified to record verification results")
| Some outfile -> outfile | Some outfile -> outfile
in in
record_verification_result verification_results outfile record_verification_result verification_results outfile
......
...@@ -133,11 +133,11 @@ module Query = struct ...@@ -133,11 +133,11 @@ module Query = struct
match of_yojson (Yojson.Safe.from_file s) with match of_yojson (Yojson.Safe.from_file s) with
| Ok t -> t | Ok t -> t
| Error msg -> | Error msg ->
invalid_arg Logging.user_error (fun m ->
(Fmt.str "Unrecognized JSON configuration in file '%s' (%s)" s msg) m "Unrecognized JSON configuration in file '%s' (%s)" s msg)
| exception Yojson.Json_error msg -> | exception Yojson.Json_error msg ->
failwith Logging.user_error (fun m ->
(Fmt.str "Unexpected error while parsing JSON file '%s' (%s)" s msg) m "Unexpected error while parsing JSON file '%s' (%s)" s msg)
in in
let query = let query =
(* Precedence to the command line option, if any. *) (* Precedence to the command line option, if any. *)
...@@ -160,8 +160,8 @@ module Query = struct ...@@ -160,8 +160,8 @@ module Query = struct
| None -> | None ->
Logging.user_error (fun m -> Logging.user_error (fun m ->
m m
"@[No output file while creating verification query from JSON \ "@[No output file specified while creating verification query from \
file@]")) JSON file@]"))
| Some _ as output_file -> { query with output_file } | Some _ as output_file -> { query with output_file }
let pretty fmt = Fmt.fmt "%a" fmt pp let pretty fmt = Fmt.fmt "%a" fmt pp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment