DEENESPTFRRUARHIKOZHNL

class ara::diag::DiagException

[SWS_DM_00515] Upstream: RS_AP_00119

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

Exception type thrown by Diag classes.

Header-Datei#include "ara/diag/diag_error_domain.h"
Forwarding-Header#include "ara/diag/diag_fwd.h"
Scopenamespace ara::diag
Basisklasse(n)ara::core::Exception

User GuideAI-GENERATED

Serves to encapsulate and forward diagnostic error codes as C++ exceptions to higher-level function callers.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 61473cb95c98 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves to encapsulate and forward diagnostic error codes as C++ exceptions to higher-level function callers.

The class ara::diag::DiagException functions as a specialized exception type for signaling errors from diagnostic classes of the AUTOSAR Adaptive Platform ([SWS_DM_00515]). It encapsulates a ara::core::ErrorCode and is thrown on internal errors to propagate error states in a structured manner to calling applications ([SWS_DM_00516]). Its constructor is declared thread-safe and exception-safe by noexcept ([SWS_DM_00516]).

Context

The class ara::diag::DiagException forms the central exception type for the functional cluster of the AUTOSAR Adaptive Platform Diagnostics (SWS Diagnostics §8.11.4 “Class: DiagException”, [SWS_DM_00515]). It derives directly from the base class ara::core::Exception and is responsible for reporting error conditions occurring within the diagnostic classes to the caller in exceptional cases. Primary interaction partners are the providing diagnostic classes within ara::diag, which signal exceptional situations, as well as the consuming application software that requests diagnostic operations and catches potential exceptions. Through its declaration in the header file ara/diag/diag_error_domain.h, the exception class is directly linked to the diagnostic-specific error domains ([SWS_DM_00516]).

Lifecycle

Instantiation of ara::diag::DiagException is performed by passing an error code of type ara::core::ErrorCode to the constructor ([SWS_DM_00516]). This constructor is defined as explicit, which prevents implicit type conversions from error codes. Furthermore, the creation is declared as noexcept, which guarantees exception safety (\"exception safe\") during object creation and prevents another exception from being thrown while raising an exception state ([SWS_DM_00516]). Thread safety (\"thread-safe\") is guaranteed for invoking the constructor ([SWS_DM_00516]). Regarding the further life cycle, the exception object exists for the duration of the stack unwinding process until the completion of the associated catch block (Interpretation: Ownership and destruction of the exception object follow the standardized mechanisms of the C++ runtime environment). Question Q-ae485b4ea411b187 (open)

Usage Path

The regular usage path of ara::diag::DiagException spans from the detection of an error situation in the diagnostic subsystem to evaluation by the application layer. The following sequence illustrates the interaction of the involved components:

Sequence when throwing and handling a DiagExceptionApplicationara::diag-KlasseDiagExceptionDiagnosefunktion aufrufenUse Case: Error case in diagnostic clusterDiagException(err) instanziierenthrow DiagExceptionHandle exception in catch block

Sequence diagram: Typical sequence during the occurrence, throwing, and handling of a DiagException. Sources: [SWS_DM_00515], [SWS_DM_00516].

The application initially initiates an operation on a functional class of the module ara::diag. If a condition occurs during processing that precludes a regular return path, the diagnostic class creates an instance of ara::diag::DiagException, specifying the particular ara::core::ErrorCode ([SWS_DM_00516]). This exception is thrown via the normal C++ exception mechanism. The calling application instance catches the object in a typed exception handler to initiate appropriate recovery or logging actions.

Error Scenarios

As an error-signaling class, ara::diag::DiagException primarily serves the propagation of diagnostic error conditions. The precondition for successful construction is the provisioning of an initialized parameter err of type ara::core::ErrorCode ([SWS_DM_00516]). The exception safety of the constructor ensures that no secondary exceptions are raised in the construction path, even in resource-critical situations ([SWS_DM_00516]). After successful instantiation, the object fully encapsulates the passed error code (Interpretation: The concrete diagnostic error code is likely inspected by the catching application logic via the inherited base mechanisms of ara::core::Exception). Question Q-d20a61b72951321b (open)

This guide was curated by an AI based on the AUTOSAR AP R25-11 specification.

UML class diagram

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

G nara__diag__DiagException942 DiagException + DiagException() nara__core__Exception792 Exception nara__diag__DiagException942->nara__core__Exception792 nstd__exception10 std::exception nara__core__Exception792->nstd__exception10

Constructors and destructor

DiagException function

Construct a new DiagException from an ErrorCode.

explicit DiagException (ara::core::ErrorCode err) noexcept;

Method documentation

function DiagException [SWS_DM_00516] Upstream: RS_AP_00119

explicit DiagException (ara::core::ErrorCode err) noexcept;

Construct a new DiagException from an ErrorCode.

Header-Datei#include "ara/diag/diag_error_domain.h"
Scopeclass ara::diag::DiagException
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
errthe ErrorCode

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

Record
AUTOSAR/AP/record/SWS_DM_00516
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00516@rel:R25-11#027392ad
Content hash
027392ad
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00516
Status: valid/unmigrated Version: rel:R25-11#6bef63b1 Versionshistorie & Revisions (1 transition, 7 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_DM_00516@rel:R25-11#6bef63b1
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#027392ad2026-09-30
  • R20-11rel:R20-11#f80be4a32026-10-14
  • R21-11rel:R21-11#e1dfd6d02026-10-14
  • R22-11rel:R22-11#c06b421b2026-10-14
  • R23-11rel:R23-11#d17f9fbb2026-10-14
  • R24-11rel:R24-11#6bef63b12026-10-14
  • R25-11rel:R25-11#6bef63b12026-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