Diese Seite wurde vollständig KI-generiert auf Basis von SWS Safe Hardware Acceleration (R25-11) — kein offizieller AUTOSAR-Text und keine automatisch extrahierte API-Seite wie die übrigen Module. Als Interpretation gekennzeichnete Aussagen sind Schlussfolgerungen aus den Quellen.
Encapsulates error codes of the shwa module as a C++ exception for thread-safe signaling and handling of errors.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 1a4cf59da390ProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Encapsulates error codes of the shwa module as a C++ exception for thread-safe signaling and handling of errors.
The class ara::shwa::ShwaException derives from ara::core::Exception and is used in the module shwa to signal error situations via the C++ exception mechanism. During instantiation, the explicit constructor accepts an ara::core::ErrorCode that encapsulates the cause of the error and provides it for diagnosis in the catch block [AP_SWS_SHWA_01303]. According to [AP_SWS_SHWA_01303], the creation is specified as noexcept, exception-safe, and thread-safe. Interpretation: Callers should catch the exception in a structured manner and evaluate the error code to prevent unhandled process terminations. Question (open)
Context
The class ara::shwa::ShwaException represents the specialized exception class for signaling module-specific error situations in module shwa of the AUTOSAR Adaptive Platform. According to class syntax, the type publicly derives from ara::core::Exception and thus fits into the unified exception hierarchy of the Adaptive Platform. In the system architecture, the class acts as a bridge between the internal components of module shwa and the calling application layers. Its primary purpose is to transport an ara::core::ErrorCode via the C++ exception mechanism, as evidenced by the constructor declaration according to [AP_SWS_SHWA_01303]. Application code is likely to use the class as a catch type to specifically distinguish errors from module shwa from generic platform exceptions. Question Q-c74c928a939e73ad (open)
Lifecycle
The lifecycle of an instance of ara::shwa::ShwaException begins with its creation in the context of error detection. According to [AP_SWS_SHWA_01303], creation takes place via the constructor explicit ShwaException(ara::core::ErrorCode errorCode) noexcept. Initialization binds the passed error code directly to the exception object. The specification guarantees full exception safety (exception safe) and thread safety (thread-safe) for this declaration [AP_SWS_SHWA_01303]. Since the constructor is declared as noexcept, object creation itself is guaranteed not to trigger secondary exceptions.
After creation, the object is passed to the C++ runtime system via a throw statement. The runtime system handles management during stack unwinding until the object is bound in a compatible catch block. After exiting the exception block, the lifetime ends and the object is automatically destroyed. Since creation is specified as thread-safe [AP_SWS_SHWA_01303], multiple execution threads can create and throw instances independently of one another.
Usage Path
A typical usage path begins with an application calling a function of module shwa. If the operation fails and the module-specific semantics provide for an exception, the executing component instantiates ara::shwa::ShwaException, passing the applicable ara::core::ErrorCode[AP_SWS_SHWA_01303]. The exception is then thrown.
The calling application code catches the exception either as ara::shwa::ShwaException or via the base class ara::core::Exception. In the catch block, the encapsulated error code can be read to analyze the cause, write log entries, or initiate recovery measures. The following sequence illustrates this path.
Sequence diagram: Typical sequence of exception creation and handling for function calls in the shwa module. Sources: [AP_SWS_SHWA_01303]
Error Scenarios
As an exception class, ara::shwa::ShwaException itself serves to signal error scenarios. As its only precondition, construction requires passing an ara::core::ErrorCode[AP_SWS_SHWA_01303]. Marking the constructor with explicit prevents unintended implicit type conversions at compile time.
Error states during construction of the exception are ruled out, since the constructor according to [AP_SWS_SHWA_01303] is declared with noexcept. Instantiation is therefore robust and does not lead to allocation errors or runtime aborts. A critical error scenario only arises at the system level if a thrown exception is not caught by the calling context: via the standard mechanism of C++, this leads to a call to std::terminate. Interpretation: Callers should safeguard the exception region and handle the error code to ensure process stability. Question Q-0b08103bdf1368b7 (open)
This guide is based exclusively on the interface specification of the shwa module in AUTOSAR Adaptive Release R25-11.
gemini-3.8-flash-low· 2026-10-13 · German original