diff --git a/bin/main.ml b/bin/main.ml index e7be7ef..8ae8771 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -70,7 +70,8 @@ let ical2rem (args : CommandLine.cli_args) ical_files = good_rems @ good_rems_acc end with e -> - Utils.warn "Error: could not read file %s: %s\n" filename (Printexc.to_string e); + Printf.eprintf "Error: could not read file %s: %s\n%s" filename (Printexc.to_string e) + (Printexc.get_backtrace ()); good_rems_acc) in @@ -82,7 +83,12 @@ let ical2rem (args : CommandLine.cli_args) ical_files = in try ListLabels.iter good_rems ~f:(fun rem -> Printf.printf "%s" (Remind.string_of_rem rem)) with e -> - Printf.eprintf "Error processing reminders: %s\n" (Printexc.to_string e); + Printf.eprintf "Error processing reminders: %s\n%s" (Printexc.to_string e) (Printexc.get_backtrace ()); exit 1 -let () = if !Sys.interactive then () else exit (CommandLine.main ical2rem) +let () = + if !Sys.interactive then () + else begin + Printexc.record_backtrace true; + exit (CommandLine.main ical2rem) + end