AutosarC++19_03-A15.3.4¶
Catch-all (ellipsis and std::exception) handlers shall be used only in (a) main, (b) task main functions, (c) in functions that are supposed to isolate independent components and (d) when calling third-party code that uses exceptions not according to AUTOSAR C++14 guidelines
Required inputs: IR
catch(...) unless you re-throw the exception.Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
catch_all |
Use of catch(…). |
None |
False |
catch_std_exception |
Catching std::exceptions is too general. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
allow_in_extern_c_functions¶
allow_in_extern_c_functions : bool = False
extern C functions.
allow_in_functions_matching¶
allow_in_functions_matching : typing.Pattern[str] | None = None
None, a re.compile()ed object where functions
whose qualified name matches the regex are allowed to contain catch-alls.
allow_in_main¶
allow_in_main : bool = True
allow_in_thread_main¶
allow_in_thread_main : bool = True
allow_rethrow¶
allow_rethrow : bool = False
autosar_exception_model¶
autosar_exception_model
The default model for what counts as an checked / unchecked exception.Type: bauhaus.ir.autosar.exceptions.autosar_exceptions.AutosarExceptionModel
Default:
<bauhaus.ir.autosar.exceptions.autosar_exceptions.AutosarExceptionModel object at 0x7f6f1d938d90>
disallow_std_exception¶
disallow_std_exception : bool = True