DEENESPTFRRUARHIKOZHNL

class ara::diag::DiagOfferException

[SWS_DM_00985] Upstream: RS_AP_00119

class DiagOfferException :           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 for error signaling via exceptions with an error code when offering diagnostic services.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 3b24259852fb Provenance Open questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves for error signaling via exceptions with an error code when offering diagnostic services.

The class ara::diag::DiagOfferException serves as a specific C++ exception type thrown by diagnostic classes of the AUTOSAR Adaptive Platform to signal errors ([SWS_DM_00985]). It derives from ara::core::Exception and is instantiated in a thread-safe manner via an noexcept constructor specifying a ara::core::ErrorCode ([SWS_DM_00986]). The exception is likely to occur primarily when offering diagnostic services fails and must be caught by the calling application to prevent uncontrolled process termination. Question (open)

Context

The class ara::diag::DiagOfferException is a central exception type of the diagnostic module within the AUTOSAR Adaptive Platform ([SWS_DM_00985], SWS Diagnostics §8.11.6 “Class: DiagOfferException”). According to its specification, it is an exception thrown by diagnostic classes (\"Exception type thrown by Diag classes\"). The class derives publicly from the base class ara::core::Exception and is to be included in applications via the header ara/diag/diag_error_domain.h ([SWS_DM_00986]).

Primary interaction partners include functional classes of diagnostic management, the underlying error architecture of AUTOSAR Adaptive (represented by ara::core::ErrorCode), and the application software offering diagnostic services. The class name suggests that this exception is presumably used when the offering or registration of diagnostic services by corresponding Diag classes fails (interpretation). Question Q-47046201c9fd38c3 (open)

Lifecycle

Instantiation of ara::diag::DiagOfferException is performed via its only specified constructor explicit DiagOfferException(ara::core::ErrorCode err) noexcept ([SWS_DM_00986], SWS Diagnostics §8.11.6.1.1.1 “DiagOfferException”). In doing so, the exception is directly bound to a concrete error code. Since the constructor is declared as noexcept, it is guaranteed that no further errors or recursive exceptions occur during the creation of the exception object itself ([SWS_DM_00986]).

Regarding its life cycle, the class is subject to the usual mechanisms of C++ exception handling: it is allocated in the runtime environment's exception storage, transported across the call stack, and automatically released after execution of the handling catch block. According to the specification, construction is thread-safe and exception-safe ([SWS_DM_00986]). After its creation, the exception object has no complex internal state transitions; it is likely to function as an immutable transport wrapper for the passed error code (interpretation). Question Q-09c6e0ad610717e9 (open)

Usage Path

The typical sequence when using ara::diag::DiagOfferException is divided into the following phases:

  • An application invokes a method of a diagnostic class to provide a diagnostic service or port (offer operation).
  • During initialization or registration, the diagnostic class detects an error condition and instantiates a suitable ara::core::ErrorCode.
  • The diagnostic class constructs an instance of ara::diag::DiagOfferException by passing this error code ([SWS_DM_00986]) and throws this exception.
  • The calling application software catches the exception within a try-catch block.
  • The caller extracts the error code from the exception and initiates suitable fallback or retry strategies.
Error handling on failed offering via DiagOfferExceptionApplicationDiag-KlasseDiagOfferExceptionDienst anbieten (Offer)Fehler festgestellt: ErrorCode erzeugenDiagOfferException(err)throw DiagOfferExceptioncatch (const DiagOfferException& e)Evaluate and handle ErrorCode

Sequence diagram: Typical sequence during signaling and handling of an error via DiagOfferException. Sources: [SWS_DM_00985], [SWS_DM_00986].

Error Scenarios

ara::diag::DiagOfferException itself serves as a signaling mechanism for error situations. As a precondition for instantiation, a valid ara::core::ErrorCode must be available to the calling instance ([SWS_DM_00986]). Since the constructor is defined as noexcept, instantiation under no circumstances leads to secondary exceptions ([SWS_DM_00986]).

If a thrown DiagOfferException is not caught by the application software, this leads by default to a call to std::terminate and thus to an uncontrolled crash of the process. Due to inheritance from ara::core::Exception, it is presumably intended that, in addition to specifically catching ara::diag::DiagOfferException, a generic handler for ara::core::Exception can also take effect (interpretation) in order to ensure robust fault tolerance at the process level. Question Q-d0cf602a077c4dae (open)

This guide is based on the AUTOSAR Adaptive R25-11 specification (module diag) and was generated automatically for autodocs.

UML class diagram

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

G nara__diag__DiagOfferException442 DiagOfferException + DiagOfferException() nara__core__Exception792 Exception nara__diag__DiagOfferException442->nara__core__Exception792 nstd__exception10 std::exception nara__core__Exception792->nstd__exception10

Constructors and destructor

Construct a new DiagException from an ErrorCode.

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

Method documentation

function DiagOfferException [SWS_DM_00986] Upstream: RS_AP_00119

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

Construct a new DiagException from an ErrorCode.

Header-Datei#include "ara/diag/diag_error_domain.h"
Scopeclass ara::diag::DiagOfferException
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_00986
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00986@rel:R25-11#346e6070
Content hash
346e6070
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00986
Status: valid/unmigrated Version: rel:R25-11#5fd23a99 Versionshistorie & Revisions (1 transition, 4 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_00986@rel:R25-11#5fd23a99
Point-in-Time History:
Recorded Revisions (4):
  • R25-11rel:R25-11#346e60702026-09-30
  • R23-11rel:R23-11#f79e89952026-10-14
  • R24-11rel:R24-11#5fd23a992026-10-14
  • R25-11rel:R25-11#5fd23a992026-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