@ -149,233 +149,518 @@ exception Use_after_free of Localise.error_desc * L.ml_loc
exception Wrong_argument_number of L . ml_loc
exception Wrong_argument_number of L . ml_loc
(* * Turn an exception into a descriptive string, error description, location in ml source, and category *)
type t =
{ name : IssueType . t
; description : Localise . error_desc
; ml_loc : Logging . ml_loc option (* * location in the infer source code *)
; visibility : visibility
; severity : severity
; kind : err_kind option
; category : err_class }
let recognize_exception exn =
let recognize_exception exn =
let err_name , desc , ( ml_loc_opt : L . ml_loc option ) , visibility , severity , force_kind , eclass =
match exn with
match exn with
(* all the static names of errors must be defined in Config.IssueType *)
(* all the static names of errors must be defined in Config.IssueType *)
| Abduction_case_not_implemented ml_loc
| Abduction_case_not_implemented ml_loc
-> { name = IssueType . abduction_case_not_implemented
-> ( IssueType . abduction_case_not_implemented
; description = Localise . no_desc
, Localise . no_desc
; ml_loc = Some ml_loc
, Some ml_loc
; visibility = Exn_developer
, Exn_developer
; severity = Low
, Low
; kind = None
, None
; category = Nocat }
, Nocat )
| Context_leak ( desc , _ )
| Context_leak ( desc , _ )
-> { name = IssueType . context_leak
-> ( IssueType . context_leak , desc , None , Exn_user , High , None , Nocat )
; description = desc
| Analysis_stops ( desc , ml_loc_opt )
; ml_loc = None
-> let visibility = if Config . analysis_stops then Exn_user else Exn_developer in
; visibility = Exn_user
( IssueType . analysis_stops , desc , ml_loc_opt , visibility , Medium , None , Nocat )
; severity = High
| Array_of_pointsto ml_loc
; kind = None
-> ( IssueType . array_of_pointsto
; category = Nocat }
, Localise . no_desc
| Analysis_stops ( desc , ml_loc_opt )
, Some ml_loc
-> let visibility = if Config . analysis_stops then Exn_user else Exn_developer in
, Exn_developer
{ name = IssueType . analysis_stops
, Low
; description = desc
, None
; ml_loc = ml_loc_opt
, Nocat )
; visibility
| Array_out_of_bounds_l1 ( desc , ml_loc )
; severity = Medium
-> ( IssueType . array_out_of_bounds_l1 , desc , Some ml_loc , Exn_user , High , Some Kerror , Checker )
; kind = None
| Array_out_of_bounds_l2 ( desc , ml_loc )
; category = Nocat }
-> ( IssueType . array_out_of_bounds_l2 , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
| Array_of_pointsto ml_loc
| Array_out_of_bounds_l3 ( desc , ml_loc )
-> { name = IssueType . array_of_pointsto
-> ( IssueType . array_out_of_bounds_l3 , desc , Some ml_loc , Exn_developer , Medium , None , Nocat )
; description = Localise . no_desc
| Assert_failure ( f , l , c )
; ml_loc = Some ml_loc
-> let ml_loc = ( f , l , c , c ) in
; visibility = Exn_developer
( IssueType . assert_failure , Localise . no_desc , Some ml_loc , Exn_developer , High , None , Nocat )
; severity = Low
| Bad_footprint ml_loc
; kind = None
-> ( IssueType . bad_footprint , Localise . no_desc , Some ml_loc , Exn_developer , Low , None , Nocat )
; category = Nocat }
| Cannot_star ml_loc
| Array_out_of_bounds_l1 ( desc , ml_loc )
-> ( IssueType . cannot_star , Localise . no_desc , Some ml_loc , Exn_developer , Low , None , Nocat )
-> { name = IssueType . array_out_of_bounds_l1
| Class_cast_exception ( desc , ml_loc )
; description = desc
-> ( IssueType . class_cast_exception , desc , Some ml_loc , Exn_user , High , None , Prover )
; ml_loc = Some ml_loc
| Codequery desc
; visibility = Exn_user
-> ( IssueType . codequery , desc , None , Exn_user , High , None , Prover )
; severity = High
| Comparing_floats_for_equality ( desc , ml_loc )
; kind = Some Kerror
-> ( IssueType . comparing_floats_for_equality , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
; category = Checker }
| Condition_always_true_false ( desc , b , ml_loc )
| Array_out_of_bounds_l2 ( desc , ml_loc )
-> let name =
-> { name = IssueType . array_out_of_bounds_l2
if b then IssueType . condition_always_true else IssueType . condition_always_false
; description = desc
in
; ml_loc = Some ml_loc
( name , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
; visibility = Exn_user
| Custom_error ( error_msg , desc )
; severity = Medium
-> ( IssueType . from_string error_msg , desc , None , Exn_user , High , None , Checker )
; kind = None
| Dangling_pointer_dereference ( dko , desc , ml_loc )
; category = Nocat }
-> let visibility =
| Array_out_of_bounds_l3 ( desc , ml_loc )
match dko with
-> { name = IssueType . array_out_of_bounds_l3
| Some _
; description = desc
-> Exn_user (* only show to the user if the category was identified *)
; ml_loc = Some ml_loc
| None
; visibility = Exn_developer
-> Exn_developer
; severity = Medium
; kind = None
; category = Nocat }
| Assert_failure ( f , l , c )
-> let ml_loc = ( f , l , c , c ) in
{ name = IssueType . assert_failure
; description = Localise . no_desc
; ml_loc = Some ml_loc
; visibility = Exn_developer
; severity = High
; kind = None
; category = Nocat }
| Bad_footprint ml_loc
-> { name = IssueType . bad_footprint
; description = Localise . no_desc
; ml_loc = Some ml_loc
; visibility = Exn_developer
; severity = Low
; kind = None
; category = Nocat }
| Cannot_star ml_loc
-> { name = IssueType . cannot_star
; description = Localise . no_desc
; ml_loc = Some ml_loc
; visibility = Exn_developer
; severity = Low
; kind = None
; category = Nocat }
| Class_cast_exception ( desc , ml_loc )
-> { name = IssueType . class_cast_exception
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Codequery desc
-> { name = IssueType . codequery
; description = desc
; ml_loc = None
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Comparing_floats_for_equality ( desc , ml_loc )
-> { name = IssueType . comparing_floats_for_equality
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = Medium
; kind = None
; category = Nocat }
| Condition_always_true_false ( desc , b , ml_loc )
-> let name = if b then IssueType . condition_always_true else IssueType . condition_always_false in
{ name
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = Medium
; kind = None
; category = Nocat }
| Custom_error ( error_msg , desc )
-> { name = IssueType . from_string error_msg
; description = desc
; ml_loc = None
; visibility = Exn_user
; severity = High
; kind = None
; category = Checker }
| Dangling_pointer_dereference ( dko , desc , ml_loc )
-> let visibility =
match dko with
| Some _
-> Exn_user (* only show to the user if the category was identified *)
| None
-> Exn_developer
in
{ name = IssueType . dangling_pointer_dereference
; description = desc
; ml_loc = Some ml_loc
; visibility
; severity = High
; kind = None
; category = Prover }
| Deallocate_stack_variable desc
-> { name = IssueType . deallocate_stack_variable
; description = desc
; ml_loc = None
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Deallocate_static_memory desc
-> { name = IssueType . deallocate_static_memory
; description = desc
; ml_loc = None
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Deallocation_mismatch ( desc , ml_loc )
-> { name = IssueType . deallocation_mismatch
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Divide_by_zero ( desc , ml_loc )
-> { name = IssueType . divide_by_zero
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = Some Kerror
; category = Checker }
| Double_lock ( desc , ml_loc )
-> { name = IssueType . double_lock
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = Some Kerror
; category = Prover }
| Eradicate ( kind_s , desc )
-> { name = IssueType . from_string kind_s
; description = desc
; ml_loc = None
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Empty_vector_access ( desc , ml_loc )
-> { name = IssueType . empty_vector_access
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = Some Kerror
; category = Prover }
| Field_not_null_checked ( desc , ml_loc )
-> { name = IssueType . field_not_null_checked
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = Medium
; kind = Some Kwarning
; category = Nocat }
| Frontend_warning ( ( name , hum ) , desc , ml_loc )
-> { name = IssueType . from_string name ? hum
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = Medium
; kind = None
; category = Linters }
| Checkers ( kind_s , desc )
-> { name = IssueType . from_string kind_s
; description = desc
; ml_loc = None
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Null_dereference ( desc , ml_loc )
-> { name = IssueType . null_dereference
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Null_test_after_dereference ( desc , ml_loc )
-> { name = IssueType . null_test_after_dereference
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = None
; category = Nocat }
| Pointer_size_mismatch ( desc , ml_loc )
-> { name = IssueType . pointer_size_mismatch
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = Some Kerror
; category = Checker }
| Inherently_dangerous_function desc
-> { name = IssueType . inherently_dangerous_function
; description = desc
; ml_loc = None
; visibility = Exn_developer
; severity = Medium
; kind = None
; category = Nocat }
| Internal_error desc
-> { name = IssueType . internal_error
; description = desc
; ml_loc = None
; visibility = Exn_developer
; severity = High
; kind = None
; category = Nocat }
| Java_runtime_exception ( exn_name , _ , desc )
-> let exn_str = Typ . Name . name exn_name in
{ name = IssueType . from_string exn_str
; description = desc
; ml_loc = None
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Leak ( fp_part , _ , ( exn_vis , error_desc ) , done_array_abstraction , resource , ml_loc )
-> if done_array_abstraction then
{ name = IssueType . leak_after_array_abstraction
; description = error_desc
; ml_loc = Some ml_loc
; visibility = Exn_developer
; severity = High
; kind = None
; category = Prover }
else if fp_part then
{ name = IssueType . leak_in_footprint
; description = error_desc
; ml_loc = Some ml_loc
; visibility = Exn_developer
; severity = High
; kind = None
; category = Prover }
else
let name =
match resource with
| PredSymb . Rmemory _
-> IssueType . memory_leak
| PredSymb . Rfile
-> IssueType . resource_leak
| PredSymb . Rlock
-> IssueType . resource_leak
| PredSymb . Rignore
-> IssueType . memory_leak
in
in
( IssueType . dangling_pointer_dereference , desc , Some ml_loc , visibility , High , None , Prover )
{ name
| Deallocate_stack_variable desc
; description = error_desc
-> ( IssueType . deallocate_stack_variable , desc , None , Exn_user , High , None , Prover )
; ml_loc = Some ml_loc
| Deallocate_static_memory desc
; visibility = exn_vis
-> ( IssueType . deallocate_static_memory , desc , None , Exn_user , High , None , Prover )
; severity = High
| Deallocation_mismatch ( desc , ml_loc )
; kind = None
-> ( IssueType . deallocation_mismatch , desc , Some ml_loc , Exn_user , High , None , Prover )
; category = Prover }
| Divide_by_zero ( desc , ml_loc )
| Missing_fld ( fld , ml_loc )
-> ( IssueType . divide_by_zero , desc , Some ml_loc , Exn_user , High , Some Kerror , Checker )
-> let desc = Localise . verbatim_desc ( Typ . Fieldname . to_full_string fld ) in
| Double_lock ( desc , ml_loc )
{ name = IssueType . missing_fld
-> ( IssueType . double_lock , desc , Some ml_loc , Exn_user , High , Some Kerror , Prover )
; description = desc
| Eradicate ( kind_s , desc )
; ml_loc = Some ml_loc
-> ( IssueType . from_string kind_s , desc , None , Exn_user , High , None , Prover )
; visibility = Exn_developer
| Empty_vector_access ( desc , ml_loc )
; severity = Medium
-> ( IssueType . empty_vector_access , desc , Some ml_loc , Exn_user , High , Some Kerror , Prover )
; kind = None
| Field_not_null_checked ( desc , ml_loc )
; category = Nocat }
-> ( IssueType . field_not_null_checked
| Premature_nil_termination ( desc , ml_loc )
, desc
-> { name = IssueType . premature_nil_termination
, Some ml_loc
; description = desc
, Exn_user
; ml_loc = Some ml_loc
, Medium
; visibility = Exn_user
, Some Kwarning
; severity = High
, Nocat )
; kind = None
| Frontend_warning ( ( name , hum ) , desc , ml_loc )
; category = Prover }
-> ( IssueType . from_string name ? hum , desc , Some ml_loc , Exn_user , Medium , None , Linters )
| Parameter_not_null_checked ( desc , ml_loc )
| Checkers ( kind_s , desc )
-> { name = IssueType . parameter_not_null_checked
-> ( IssueType . from_string kind_s , desc , None , Exn_user , High , None , Prover )
; description = desc
| Null_dereference ( desc , ml_loc )
; ml_loc = Some ml_loc
-> ( IssueType . null_dereference , desc , Some ml_loc , Exn_user , High , None , Prover )
; visibility = Exn_user
| Null_test_after_dereference ( desc , ml_loc )
; severity = Medium
-> ( IssueType . null_test_after_dereference , desc , Some ml_loc , Exn_user , High , None , Nocat )
; kind = Some Kwarning
| Pointer_size_mismatch ( desc , ml_loc )
; category = Nocat }
-> ( IssueType . pointer_size_mismatch , desc , Some ml_loc , Exn_user , High , Some Kerror , Checker )
| Precondition_not_found ( desc , ml_loc )
| Inherently_dangerous_function desc
-> { name = IssueType . precondition_not_found
-> ( IssueType . inherently_dangerous_function , desc , None , Exn_developer , Medium , None , Nocat )
; description = desc
| Internal_error desc
; ml_loc = Some ml_loc
-> ( IssueType . internal_error , desc , None , Exn_developer , High , None , Nocat )
; visibility = Exn_developer
| Java_runtime_exception ( exn_name , _ , desc )
; severity = Low
-> let exn_str = Typ . Name . name exn_name in
; kind = None
( IssueType . from_string exn_str , desc , None , Exn_user , High , None , Prover )
; category = Nocat }
| Leak ( fp_part , _ , ( exn_vis , error_desc ) , done_array_abstraction , resource , ml_loc )
| Precondition_not_met ( desc , ml_loc )
-> if done_array_abstraction then
-> { name = IssueType . precondition_not_met
( IssueType . leak_after_array_abstraction
; description = desc
, error_desc
; ml_loc = Some ml_loc
, Some ml_loc
; visibility = Exn_developer
, Exn_developer
; severity = Medium
, High
; kind = Some Kwarning
, None
; category = Nocat }
, Prover )
(* always a warning *)
else if fp_part then
| Retain_cycle ( _ , desc , ml_loc )
( IssueType . leak_in_footprint , error_desc , Some ml_loc , Exn_developer , High , None , Prover )
-> { name = IssueType . retain_cycle
else
; description = desc
let loc_str =
; ml_loc = Some ml_loc
match resource with
; visibility = Exn_user
| PredSymb . Rmemory _
; severity = High
-> IssueType . memory_leak
; kind = None
| PredSymb . Rfile
; category = Prover }
-> IssueType . resource_leak
| Registered_observer_being_deallocated ( desc , ml_loc )
| PredSymb . Rlock
-> { name = IssueType . registered_observer_being_deallocated
-> IssueType . resource_leak
; description = desc
| PredSymb . Rignore
; ml_loc = Some ml_loc
-> IssueType . memory_leak
; visibility = Exn_user
in
; severity = High
( loc_str , error_desc , Some ml_loc , exn_vis , High , None , Prover )
; kind = Some Kerror
| Missing_fld ( fld , ml_loc )
; category = Nocat }
-> let desc = Localise . verbatim_desc ( Typ . Fieldname . to_full_string fld ) in
| Return_expression_required ( desc , ml_loc )
( IssueType . missing_fld , desc , Some ml_loc , Exn_developer , Medium , None , Nocat )
-> { name = IssueType . return_expression_required
| Premature_nil_termination ( desc , ml_loc )
; description = desc
-> ( IssueType . premature_nil_termination , desc , Some ml_loc , Exn_user , High , None , Prover )
; ml_loc = Some ml_loc
| Parameter_not_null_checked ( desc , ml_loc )
; visibility = Exn_user
-> ( IssueType . parameter_not_null_checked
; severity = Medium
, desc
; kind = None
, Some ml_loc
; category = Nocat }
, Exn_user
| Stack_variable_address_escape ( desc , ml_loc )
, Medium
-> { name = IssueType . stack_variable_address_escape
, Some Kwarning
; description = desc
, Nocat )
; ml_loc = Some ml_loc
| Precondition_not_found ( desc , ml_loc )
; visibility = Exn_user
-> ( IssueType . precondition_not_found , desc , Some ml_loc , Exn_developer , Low , None , Nocat )
; severity = High
| Precondition_not_met ( desc , ml_loc )
; kind = Some Kerror
-> ( IssueType . precondition_not_met
; category = Nocat }
, desc
| Return_statement_missing ( desc , ml_loc )
, Some ml_loc
-> { name = IssueType . return_statement_missing
, Exn_developer
; description = desc
, Medium
; ml_loc = Some ml_loc
, Some Kwarning
; visibility = Exn_user
, Nocat )
; severity = Medium
(* always a warning *)
; kind = None
| Retain_cycle ( _ , desc , ml_loc )
; category = Nocat }
-> ( IssueType . retain_cycle , desc , Some ml_loc , Exn_user , High , None , Prover )
| Return_value_ignored ( desc , ml_loc )
| Registered_observer_being_deallocated ( desc , ml_loc )
-> { name = IssueType . return_value_ignored
-> ( IssueType . registered_observer_being_deallocated
; description = desc
, desc
; ml_loc = Some ml_loc
, Some ml_loc
; visibility = Exn_user
, Exn_user
; severity = Medium
, High
; kind = None
, Some Kerror
; category = Nocat }
, Nocat )
| SymOp . Analysis_failure_exe _
| Return_expression_required ( desc , ml_loc )
-> { name = IssueType . failure_exe
-> ( IssueType . return_expression_required , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
; description = Localise . no_desc
| Stack_variable_address_escape ( desc , ml_loc )
; ml_loc = None
-> ( IssueType . stack_variable_address_escape
; visibility = Exn_system
, desc
; severity = Low
, Some ml_loc
; kind = None
, Exn_user
; category = Nocat }
, High
| Skip_function desc
, Some Kerror
-> { name = IssueType . skip_function
, Nocat )
; description = desc
| Return_statement_missing ( desc , ml_loc )
; ml_loc = None
-> ( IssueType . return_statement_missing , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
; visibility = Exn_developer
| Return_value_ignored ( desc , ml_loc )
; severity = Low
-> ( IssueType . return_value_ignored , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
; kind = None
| SymOp . Analysis_failure_exe _
; category = Nocat }
-> ( IssueType . failure_exe , Localise . no_desc , None , Exn_system , Low , None , Nocat )
| Skip_pointer_dereference ( desc , ml_loc )
| Skip_function desc
-> { name = IssueType . skip_pointer_dereference
-> ( IssueType . skip_function , desc , None , Exn_developer , Low , None , Nocat )
; description = desc
| Skip_pointer_dereference ( desc , ml_loc )
; ml_loc = Some ml_loc
-> ( IssueType . skip_pointer_dereference , desc , Some ml_loc , Exn_user , Medium , Some Kinfo , Nocat )
; visibility = Exn_user
(* always an info *)
; severity = Medium
| Symexec_memory_error ml_loc
; kind = Some Kinfo
-> ( IssueType . symexec_memory_error
; category = Nocat }
, Localise . no_desc
(* always an info *)
, Some ml_loc
| Symexec_memory_error ml_loc
, Exn_developer
-> { name = IssueType . symexec_memory_error
, Low
; description = Localise . no_desc
, None
; ml_loc = Some ml_loc
, Nocat )
; visibility = Exn_developer
| Uninitialized_value ( desc , ml_loc )
; severity = Low
-> ( IssueType . uninitialized_value , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
; kind = None
| Unary_minus_applied_to_unsigned_expression ( desc , ml_loc )
; category = Nocat }
-> ( IssueType . unary_minus_applied_to_unsigned_expression
| Uninitialized_value ( desc , ml_loc )
, desc
-> { name = IssueType . uninitialized_value
, Some ml_loc
; description = desc
, Exn_user
; ml_loc = Some ml_loc
, Medium
; visibility = Exn_user
, None
; severity = Medium
, Nocat )
; kind = None
| Unknown_proc
; category = Nocat }
-> ( IssueType . unknown_proc , Localise . no_desc , None , Exn_developer , Low , None , Nocat )
| Unary_minus_applied_to_unsigned_expression ( desc , ml_loc )
| Unreachable_code_after ( desc , ml_loc )
-> { name = IssueType . unary_minus_applied_to_unsigned_expression
-> ( IssueType . unreachable_code_after , desc , Some ml_loc , Exn_user , Medium , None , Nocat )
; description = desc
| Unsafe_guarded_by_access ( desc , ml_loc )
; ml_loc = Some ml_loc
-> ( IssueType . unsafe_guarded_by_access , desc , Some ml_loc , Exn_user , High , None , Prover )
; visibility = Exn_user
| Use_after_free ( desc , ml_loc )
; severity = Medium
-> ( IssueType . use_after_free , desc , Some ml_loc , Exn_user , High , None , Prover )
; kind = None
| Wrong_argument_number ml_loc
; category = Nocat }
-> ( IssueType . wrong_argument_number
| Unknown_proc
, Localise . no_desc
-> { name = IssueType . unknown_proc
, Some ml_loc
; description = Localise . no_desc
, Exn_developer
; ml_loc = None
, Low
; visibility = Exn_developer
, None
; severity = Low
, Nocat )
; kind = None
| exn
; category = Nocat }
-> L . internal_error " Backend error '%a'. Backtrace:@ \n %s " Exn . pp exn ( Exn . backtrace () ) ;
| Unreachable_code_after ( desc , ml_loc )
reraise exn
-> { name = IssueType . unreachable_code_after
in
; description = desc
( err_name , desc , ml_loc_opt , visibility , severity , force_kind , eclass )
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = Medium
; kind = None
; category = Nocat }
| Unsafe_guarded_by_access ( desc , ml_loc )
-> { name = IssueType . unsafe_guarded_by_access
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Use_after_free ( desc , ml_loc )
-> { name = IssueType . use_after_free
; description = desc
; ml_loc = Some ml_loc
; visibility = Exn_user
; severity = High
; kind = None
; category = Prover }
| Wrong_argument_number ml_loc
-> { name = IssueType . wrong_argument_number
; description = Localise . no_desc
; ml_loc = Some ml_loc
; visibility = Exn_developer
; severity = Low
; kind = None
; category = Nocat }
| exn
-> { name = IssueType . failure_exe
; description =
Localise . verbatim_desc ( F . asprintf " %a: %s " Exn . pp exn ( Caml . Printexc . get_backtrace () ) )
; ml_loc = None
; visibility = Exn_system
; severity = Low
; kind = None
; category = Nocat }
(* * print a description of the exception to the html output *)
(* * print a description of the exception to the html output *)
let print_exception_html s exn =
let print_exception_html s exn =
let err_name , desc , ml_loc_opt , _ , _ , _ , _ = recognize_exception exn in
let err or = recognize_exception exn in
let ml_loc_string =
let ml_loc_string =
match ml_loc_opt with None -> " " | Some ml_loc -> " " ^ L . ml_loc_to_string ml_loc
match error. ml_loc with None -> " " | Some ml_loc -> " " ^ L . ml_loc_to_string ml_loc
in
in
let desc_str = F . asprintf " %a " Localise . pp_error_desc desc in
let desc_str = F . asprintf " %a " Localise . pp_error_desc error. description in
L . d_strln_color Red ( s ^ err_name . IssueType . unique_id ^ " " ^ desc_str ^ ml_loc_string )
L . d_strln_color Red ( s ^ err or. name. IssueType . unique_id ^ " " ^ desc_str ^ ml_loc_string )
(* * string describing an error kind *)
(* * string describing an error kind *)
let err_kind_string = function
let err_kind_string = function
@ -413,5 +698,5 @@ let pp_err ~node_key loc ekind ex_name desc ml_loc_opt fmt () =
(* * Return true if the exception is not serious and should be handled in timeout mode *)
(* * Return true if the exception is not serious and should be handled in timeout mode *)
let handle_exception exn =
let handle_exception exn =
let _ , _ , _ , visibility , _ , _ , _ = recognize_exception exn in
let error = recognize_exception exn in
equal_visibility visibility Exn_user | | equal_visibility visibility Exn_developer
equal_visibility error. visibility Exn_user | | equal_visibility error . visibility Exn_developer