Skip to content
Snippets Groups Projects
Commit 43389849 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[MdR] proper error message with missing -mdr-out

parent db604585
No related branches found
No related tags found
No related merge requests found
...@@ -609,10 +609,15 @@ let gen_report ~draft:is_draft () = ...@@ -609,10 +609,15 @@ let gen_report ~draft:is_draft () =
in in
let doc = Markdown.pandoc ~title ~authors ?date elements in let doc = Markdown.pandoc ~title ~authors ?date elements in
let file = Mdr_params.Output.get() in let file = Mdr_params.Output.get() in
try if Filepath.Normalized.is_empty file then
Command.print_file (file:>string) (fun fmt -> Markdown.pp_pandoc fmt doc) ; Mdr_params.error "No output file specified (use option %s)."
Mdr_params.result "Report %a generated" Filepath.Normalized.pretty file Mdr_params.Output.option_name
with Sys_error s -> else
Mdr_params.warning try
"Unable to open %a for writing (%s). No report generated" Command.print_file (file:>string)
Filepath.Normalized.pretty file s (fun fmt -> Markdown.pp_pandoc fmt doc) ;
Mdr_params.result "Report %a generated" Filepath.Normalized.pretty file
with Sys_error s ->
Mdr_params.warning
"Unable to open %a for writing (%s). No report generated"
Filepath.Normalized.pretty file s
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