@@ -331,7 +331,8 @@ module IssuesJson = struct
331
331
-> (err_data.loc.Location. file, 0 )
332
332
in
333
333
if SourceFile. is_invalid source_file then
334
- failwithf
" Invalid source file for %a %[email protected] : %a@." IssueType. pp key.err_name
334
+ L. (die InternalError )
335
+ " Invalid source file for %a %[email protected] : %a@." IssueType. pp key.err_name
335
336
Localise. pp_error_desc key.err_desc Errlog. pp_loc_trace err_data.loc_trace ;
336
337
let should_report_source_file =
337
338
not (SourceFile. is_infer_model source_file) || Config. debug_mode || Config. debug_exceptions
@@ -741,39 +742,39 @@ let pp_issues_in_format (format_kind, (outf: Utils.outfile)) =
741
742
| Csv
742
743
-> IssuesCsv. pp_issues_of_error_log outf.fmt
743
744
| Tests
744
- -> failwith " Print issues as tests is not implemented"
745
+ -> L. (die InternalError ) " Print issues as tests is not implemented"
745
746
| Text
746
747
-> IssuesTxt. pp_issues_of_error_log outf.fmt
747
748
| Latex
748
- -> failwith " Printing issues in latex is not implemented"
749
+ -> L. (die InternalError ) " Printing issues in latex is not implemented"
749
750
750
751
let pp_procs_in_format (format_kind , (outf : Utils.outfile )) =
751
752
match format_kind with
752
753
| Csv
753
754
-> ProcsCsv. pp_summary outf.fmt
754
755
| Json | Latex | Tests | Text
755
- -> failwith " Printing procs in json/latex/tests/text is not implemented"
756
+ -> L. (die InternalError ) " Printing procs in json/latex/tests/text is not implemented"
756
757
757
758
let pp_calls_in_format (format_kind , (outf : Utils.outfile )) =
758
759
match format_kind with
759
760
| Csv
760
761
-> CallsCsv. pp_calls outf.fmt
761
762
| Json | Tests | Text | Latex
762
- -> failwith " Printing calls in json/tests/text/latex is not implemented"
763
+ -> L. (die InternalError ) " Printing calls in json/tests/text/latex is not implemented"
763
764
764
765
let pp_stats_in_format (format_kind , _ ) =
765
766
match format_kind with
766
767
| Csv
767
768
-> Stats. process_summary
768
769
| Json | Tests | Text | Latex
769
- -> failwith " Printing stats in json/tests/text/latex is not implemented"
770
+ -> L. (die InternalError ) " Printing stats in json/tests/text/latex is not implemented"
770
771
771
772
let pp_summary_in_format (format_kind , (outf : Utils.outfile )) =
772
773
match format_kind with
773
774
| Latex
774
775
-> Summary. write_summary_latex outf.fmt
775
776
| Json | Csv | Tests | Text
776
- -> failwith " Printing summary in json/csv/tests/text is not implemented"
777
+ -> L. (die InternalError ) " Printing summary in json/csv/tests/text is not implemented"
777
778
778
779
let pp_issues_of_error_log error_filter linereader proc_loc_opt procname err_log bug_format_list =
779
780
let pp_issues_in_format format =
@@ -848,11 +849,11 @@ let pp_json_report_by_report_kind formats_by_report_kind fname =
848
849
| Text
849
850
-> pp_text_of_report outf.fmt report
850
851
| Json
851
- -> failwith " Printing issues from json does not support json output"
852
+ -> L. (die InternalError ) " Printing issues from json does not support json output"
852
853
| Csv
853
- -> failwith " Printing issues from json does not support csv output"
854
+ -> L. (die InternalError ) " Printing issues from json does not support csv output"
854
855
| Latex
855
- -> failwith " Printing issues from json does not support latex output"
856
+ -> L. (die InternalError ) " Printing issues from json does not support latex output"
856
857
in
857
858
List. iter ~f: pp_json_issue format_list
858
859
in
@@ -869,7 +870,7 @@ let pp_json_report_by_report_kind formats_by_report_kind fname =
869
870
in
870
871
List. iter ~f: pp_report_by_report_kind formats_by_report_kind
871
872
| Error error
872
- -> failwithf " Error reading '%s': %s" fname error
873
+ -> L. (die UserError ) " Error reading '%s': %s" fname error
873
874
874
875
let pp_lint_issues_by_report_kind formats_by_report_kind error_filter linereader procname error_log =
875
876
let pp_summary_by_report_kind (report_kind , format_list ) =
0 commit comments