DEENESPTFRRUARHIKOZHNL

class ara::shwa::ShwaException

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.

[AP_SWS_SHWA_01302] wording not yet imported Upstream: RS_AP_00122, RS_AP_00127

class ShwaException : public ara::core::Exception {...};

Die Spezifikation definiert diesen Klassentyp mit der gezeigten Schnittstelle.

Header-Datei#include "ara/shwa/shwa_error_domain.h"
Scopenamespace ara::shwa

User GuideAI-GENERATED

Encapsulates error codes of the shwa module as a C++ exception for thread-safe signaling and handling of errors.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 1a4cf59da390 Provenance Open 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.

Exception handling with ShwaExceptionApplicationSHWA-ModulShwaExceptionModuloperation anfordernoptFehlerzustand eingetretenShwaException(errorCode)throw ShwaExceptioncatch (ShwaException const& ex) / Auswertung

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.

Constructors and destructor

ShwaException function

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

explicit ShwaException (ara::core::ErrorCode errorCode) noexcept;

Details

function ShwaException [AP_SWS_SHWA_01303] Upstream: RS_AP_00120, RS_AP_00121, RS_AP_00135, RS_AP_00159

explicit ShwaException (ara::core::ErrorCode errorCode) noexcept;

Die Spezifikation definiert diese Deklaration mit der in der Signatur ausgewiesenen Semantik.

Scopeclass ara::shwa::ShwaException
Thread Safetythread-safe
Exception Safetyexception safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_SHWA_01303
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_SHWA_01303@rel:R25-11#560c643e
Content hash
560c643e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_SafeHardwareAcceleration.pdf#nameddest=AP_SWS_SHWA_01303
Status: valid/unmigrated Version: rel:R25-11#560c643e Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_SHWA_01303@rel:R25-11#560c643e
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill