Encapsulates error codes of Execution Management as a C++ exception for synchronous error handling.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e102ca6cc8edProvenanceOpen questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Encapsulates error codes of Execution Management as a C++ exception for synchronous error handling.
The class ara::exec::ExecException serves as a final exception class of Execution Management for encapsulating and signaling module-specific errors via the C++ exception mechanism. In the event of an error, instances are created and thrown via the thread-safe constructor by specifying a ara::core::ErrorCode, whereupon calling sites catch and analyze them [SWS_EM_02283]. As a fundamental constraint, construction is specified as noexcept, whereby object creation is guaranteed to remain exception-safe [SWS_EM_02283]. Unhandled exceptions must be avoided, as they lead to system termination.
Context
The class ara::exec::ExecException represents the central exception class of the module Execution Management (exec) within the AUTOSAR Adaptive Platform. According to its specification, it serves as an encapsulation for exceptions thrown by Execution Management. The class declaration defines it as final with public derivation from the standard base exception class ara::core::Exception, thereby embedding it seamlessly into the uniform exception and error handling concept of the Adaptive Platform. Further specialization or subclassing is precluded by the identifier final.
The exception class is declared in header #include "ara/exec/exec_error_domain.h"[SWS_EM_02283]. The primary functional responsibility of ara::exec::ExecException lies in transporting module-specific error states via the C++ exception mechanism. Interpretation: Throwing this exception is likely to come into play primarily in execution environments in which error states of Execution Management are not propagated purely via value-based error types, but where a synchronous control flow abort via C++ exceptions is required. Question Q-8faec8c282524965 (open)
Lifecycle
The lifecycle of an instance of ara::exec::ExecException begins with explicit construction passing an error code. The constructor explicit ExecException(ara::core::ErrorCode errorCode) noexcept creates a new exception object encapsulating the passed error code [SWS_EM_02283]. The designation as noexcept ensures that the object creation itself is guaranteed to remain failure-free even in the context of an already existing error handling and does not trigger cascading secondary errors [SWS_EM_02283].
With regard to execution safety, construction is explicitly classified as exception-safe ("exception safe") and thread-safe ("thread-safe") [SWS_EM_02283]. This enables the reliable creation of exception instances across different threads without requiring additional synchronization mechanisms. After being thrown via throw, the object transitions to the management of the C++ runtime system. Interpretation: Destruction of the exception object occurs automatically after exiting the handling catch block as part of regular stack unwinding, which is why no explicit lifecycle management by the caller is necessary. Question Q-ec22ad5f177555aa (open)
Usage Path
A typical usage path of ara::exec::ExecException includes instantiation in case of error within Execution Management as well as controlled catching in the calling application context:
Error identification and instantiation: If an exceptional condition occurs in Execution Management, the cause is mapped to an ara::core::ErrorCode of the associated error domain and used for explicit initialization of an ara::exec::ExecException[SWS_EM_02283].
Signaling: The initialized exception instance is thrown, interrupting the regular execution path and initiating stack unwinding.
Catching: Calling components catch the exception object either specifically as const ara::exec::ExecException& or more generally via the polymorphic base class const ara::core::Exception&.
Evaluation: Interpretation: Since the object was constructed with an ara::core::ErrorCode[SWS_EM_02283] and inherits from ara::core::Exception, the receiver is likely to extract the contained error code via interfaces of the base class in order to perform module-specific recovery or logging measures. Question Q-d4671c34f5aab6f9 (open)
Error Scenarios
As a specialized exception class, ara::exec::ExecException is designed to map existing error situations without inducing new errors during its own usage. For creation, the constructor requires passing an ara::core::ErrorCode[SWS_EM_02283]. Since the constructor is declared as noexcept, precondition errors during instantiation that could hinder the creation of the exception object are ruled out [SWS_EM_02283].
A key error scenario at the system level lies in the incomplete catching of thrown exceptions. If an exception triggered by ara::exec::ExecException remains unhandled along the call hierarchy, the standard C++ runtime handling takes effect, which typically results in a call to std::terminate and thus in premature process termination. Interacting software components must therefore ensure that calls to potentially throwing functions of Execution Management are safeguarded by adequate try-catch blocks.
This guide was generated by an AI based on the specification AUTOSAR Adaptive Platform R25-11.
UML class diagram
Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.
gemini-3.8-flash-low· 2026-10-13 · German original