Serves to encapsulate and signal errors from the persistence module based on a specific error code.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: abab05ca22f0ProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Serves to encapsulate and signal errors from the persistence module based on a specific error code.
The class ara::per::PerException serves in the AUTOSAR Adaptive Platform as a specific exception type for signaling errors from the persistence module. It is provided via header ara/per/per_error_domain.h and inherits from base class ara::core::Exception[SWS_PER_00355]. Instantiation takes place explicitly by passing an ara::core::ErrorCode, which encapsulates the concrete error cause. By declaring the constructor as noexcept, creation is specified as completely exception-safe as well as thread-safe [SWS_PER_00355].
Context
The class ara::per::PerException acts as the central, specialized exception type for the functional cluster of persistence (module per) within the AUTOSAR Adaptive Platform in release R25-11. According to its formal syntax, the class is publicly derived from the general base exception ara::core::Exception. Its primary responsibility is to signal severe error states, or those not directly handleable via regular return values, from the persistence subsystem to higher-level application layers. The class is defined in header ara/per/per_error_domain.h[SWS_PER_00355]. In the architecture, it interacts closely with the platform's error handling infrastructure, with each instance transporting an ara::core::ErrorCode for precise error diagnosis [SWS_PER_00355].
Lifecycle
The lifecycle of an ara::per::PerException object is directly tied to the detection and propagation of an error within persistence operations. Instantiation takes place via an explicit constructor that accepts exactly one parameter of type ara::core::ErrorCode[SWS_PER_00355]. This constructor is declared as explicit to prevent implicit type conversions from error codes and is provided with the specification noexcept[SWS_PER_00355]. This ensures that no further exceptions can occur during the construction of the exception object itself; creation is thus completely exception-safe (exception safe) [SWS_PER_00355].
Regarding concurrency, the creation of ara::per::PerException is specified as thread-safe (thread-safe) [SWS_PER_00355]. After invoking the constructor, the object is thrown along the call stack. Ownership and destruction follow standard C++ rules for exception handling: The object remains in the memory area of the runtime system until the catching catch block has ended, and is subsequently destroyed deterministically.
Usage Path
The typical sequence when using ara::per::PerException is structured into the following steps:
Error detection and code creation: The persistence module identifies an invalid state or the failure of a storage operation and maps this into a corresponding ara::core::ErrorCode.
Instantiation: Passing this error code, the exception object is explicitly created via PerException(errorCode)[SWS_PER_00355].
Throwing the exception: The persistence subsystem throws the exception instance from the affected function interface.
Catching and evaluation: The calling application catches the object specifically as ara::per::PerException or polymorphically as ara::core::Exception or std::exception, respectively. Interpretation: The application is then likely to read the encapsulated ara::core::ErrorCode via the access methods inherited from the base class in order to initiate targeted troubleshooting measures. Question Q-6e48fd125d9938d8 (open)
Error Scenarios
Since ara::per::PerException serves to represent errors, error scenarios focus on the robustness of object creation and the integrity of the error information. As an essential precondition, the constructor requires a valid ara::core::ErrorCode as an input parameter [SWS_PER_00355]. Because the constructor is declared as noexcept, secondary exceptions occurring during error reporting are ruled out [SWS_PER_00355]. In addition, the specified thread safety guarantees that even with concurrent errors in multiple execution threads, no data corruption or uncoordinated side effects occur [SWS_PER_00355].
This guide is based exclusively on the specification data of AUTOSAR Adaptive Platform release 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