FaultDetection-UncaughtExceptionOutsideMain

Exceptions shall be raised only after start-up and before termination of the program

Required inputs: IR, StaticSemanticAnalysis

This check detects exceptions that could terminate the program because they escape from global initialization or finalization.

Possible Messages

Key

Text

Severity

Disabled

exception_escaping_initialization

Uncaught exception raised in initialization or finalization

None

False

Options

exclude_exception_base_classes

exclude_exception_base_classes : set[bauhaus.analysis.config.QualifiedName] = set()

Exclude issues for the exception types mentioned in this set of qualified names. Also excludes classes derived from those class names as well as pointers or references to any of these class types.
 

generate_violation_path

generate_violation_path : bool = True

Whether to compute a trace for the exception. This improves the usability of the violation description, but requires additional computing which might slow down the rule.
 

report_at_call

report_at_call : bool = False

If set to true, the error is reported at the call-sites of routines throwing exceptions rather than at the throw.
 

report_only_one_exception_per_function

report_only_one_exception_per_function : bool = False

Report at most one uncaught exception per function. This suppresses issues at sites where an uncaught exception is thrown to get a faster execution of the check. Setting this parameter to True will result in false negatives: Real issues may not be detected anymore.