DEENESPTFRRUARHIKOZHNL

class ara::phm::PhmException

[SWS_PHM_01242] Upstream: RS_AP_00119

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

Exception type thrown by Platform Health Management.

Header-Datei#include "ara/phm/phm_error_domain.h"
Forwarding-Header#include "ara/phm/phm_fwd.h"
Scopenamespace ara::phm
Basisklasse(n)ara::core::Exception

User GuideAI-GENERATED

Encapsulates error codes of Platform Health Management as a thread-safe exception for failed module operations.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9c0b25d6fb92 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Encapsulates error codes of Platform Health Management as a thread-safe exception for failed module operations.

The class ara::phm::PhmException serves in Platform Health Management as the central exception type for encapsulating and propagating module-specific errors to calling components. Upon error detection, it is explicitly instantiated with an ara::core::ErrorCode and thrown to enable structured error handling via corresponding catch blocks [SWS_PHM_01243]. As an essential boundary condition, its construction is specified as noexcept, thread-safe, and exception-safe, ruling out secondary errors during exception creation [SWS_PHM_01243]. Interpretation: Callers typically catch the object by reference in order to evaluate the contained error code deterministically without dynamic memory allocation. Question (open)

Context

The class ara::phm::PhmException acts as a dedicated exception type for Platform Health Management (PHM) within the AUTOSAR Adaptive Platform. According to the class definition, the class derives publicly from ara::core::Exception and provides the link to communicate error states of module phm to calling system and application components via the standardized C++ exception mechanism. In the system architecture, the class primarily interacts between operational PHM services, which perform monitoring functions and detect error states upon rule violations, and the application's higher-level error handling routines. Integration into the fundamental error handling model of ara::core ensures that domain-specific error reports from Platform Health Management can be transported and processed in a standardized manner.

Lifecycle

The lifecycle of an instance of ara::phm::PhmException begins with explicit instantiation in case of error. According to [SWS_PHM_01243], the object is created via constructor PhmException(ara::core::ErrorCode errorCode) including header ara/phm/phm_error_domain.h. Creation is declared as noexcept and exhibits both "exception safe" and "thread-safe" properties [SWS_PHM_01243]. This guarantees that instantiation of the exception object itself occurs safely even under high concurrency and never triggers unexpected secondary exceptions at any time.

The object encapsulates the passed ara::core::ErrorCode and has an immutable state after its creation. During stack unwinding, the exception object is transported through the runtime environment. Destruction occurs deterministically upon exiting the handling catch block according to standard C++ rules. Interpretation: Instances are likely typically created directly in the throw expression on the stack and caught by reference (const ara::phm::PhmException&), so that no dynamic memory allocation is required on the caller side. Question Q-37fc47021a78a0db (open)

Usage Path

The typical usage path begins when a monitored operation of Platform Health Management fails or an invalid state deviation is detected. The triggering PHM function then initializes an exception object with the associated error code and throws it from [SWS_PHM_01243]. On the caller side, the protected code section is executed within a try-catch block. Applications presumably catch the exception either specifically as ara::phm::PhmException or polymorphically via base class ara::core::Exception. Question Q-54638c0dde7d9195 (open) In the exception handler, the contained ara::core::ErrorCode is extracted in order to analyze the cause and initiate appropriate countermeasures or limp-home strategies.

Usage path for throwing and handling PhmExceptionApplicationPHM-Diensterror handlingPHM-FunktionsaufrufDetection of an internal errorPhmException(errorCode) werfenAuswertung von ErrorCodeReturn after error handling

Sequence diagram: Typical sequence from error detection in PHM via throwing ara::phm::PhmException to evaluation in the handler. Sources: [SWS_PHM_01243].

Error Scenarios

A central component of ara::phm::PhmException is transporting the error code at runtime. A precondition for object creation is passing a valid ara::core::ErrorCode [SWS_PHM_01243]. The postcondition of the call is a fully initialized exception object that provides the passed error code unchanged for query.

Since the constructor is explicitly specified as noexcept and "exception safe" [SWS_PHM_01243], the occurrence of exceptions during construction of the exception itself is ruled out. Failure of object creation therefore cannot occur, preventing premature termination via std::terminate during error reporting. The specified thread safety ("thread-safe") also protects against data corruption when multiple threads report error states in parallel via their own exceptions [SWS_PHM_01243]. Consequently, error scenarios do not affect the exception class itself, but reflect the functional error causes encoded in the encapsulated ara::core::ErrorCode of the PHM error domain.

This guide was generated by an AI based on the specification of AUTOSAR Adaptive Platform R25-11.

UML class diagram

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__phm__PhmException101 PhmException + PhmException() nara__core__Exception792 Exception nara__phm__PhmException101->nara__core__Exception792 nstd__exception10 std::exception nara__core__Exception792->nstd__exception10

Constructors and destructor

PhmException function

Construct a new PlatformHealthManagement exception object containing an error code.

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

Method documentation

function PhmException [SWS_PHM_01243] Upstream: RS_AP_00119, RS_AP_00159

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

Construct a new PlatformHealthManagement exception object containing an error code.

Header-Datei#include "ara/phm/phm_error_domain.h"
Scopeclass ara::phm::PhmException
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
errorCodeThe error code.

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

Record
AUTOSAR/AP/record/SWS_PHM_01243
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PHM_01243@rel:R25-11#9af686bd
Content hash
9af686bd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_PlatformHealthManagement.pdf#nameddest=SWS_PHM_01243
Status: valid/unmigrated Version: rel:R25-11#47b59c13 Versionshistorie & Revisions (1 transition, 5 revision)
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/SWS_PHM_01243@rel:R25-11#47b59c13
Point-in-Time History:
Recorded Revisions (5):
  • R25-11rel:R25-11#9af686bd2026-09-30
  • R22-11rel:R22-11#eabc2e272026-10-14
  • R23-11rel:R23-11#b6f2d9e42026-10-14
  • R24-11rel:R24-11#47b59c132026-10-14
  • R25-11rel:R25-11#47b59c132026-10-14 active
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