DEENESPTFRRUARHIKOZHNL

class ara::diag::DiagUdsNrcException

[SWS_DM_00527] Upstream: RS_AP_00119

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

Exception type thrown by Diag classes.

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

User GuideAI-GENERATED

Serves as a thread-safe exception for signaling and propagating UDS NRC errors in diagnostic classes.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 6ef167bbc303 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves as a thread-safe exception for signaling and propagating UDS NRC errors in diagnostic classes.

The class ara::diag::DiagUdsNrcException serves as a standardized exception for signaling UDS NRC errors by diagnostic classes of the AUTOSAR Adaptive Platform (AUTOSAR_AP_SWS_Diagnostics §8.12.4 “Class: DiagUdsNrcException”). When a corresponding error condition occurs, it is instantiated with a ara::core::ErrorCode, thrown, and caught by the calling application for error handling. As an essential constraint, its constructor guarantees complete exception safety (noexcept) as well as thread safety according to [SWS_DM_00528], thereby ensuring reliable object creation even in concurrent contexts.

Context

In the AUTOSAR Adaptive Platform, class ara::diag::DiagUdsNrcException forms the central exception type for diagnostic classes of the diag module (AUTOSAR_AP_SWS_Diagnostics §8.12.4 “Class: DiagUdsNrcException”). According to specification [SWS_DM_00527], it defines a standardized C++ exception interface that inherits directly from base exception class ara::core::Exception. Its primary responsibility is to transport error conditions from the diagnostic context, particularly Negative Response Codes (NRC) of the UDS protocol, as typed exceptions across the application programming interface. The class interacts closely with ara::core::ErrorCode, which encapsulates the concrete error code, as well as with calling application layers that make diagnostic requests and must catch any errors ([SWS_DM_00528]). Through declaration in header ara/diag/diag_uds_nrc_error_domain.h, the exception is directly linked to the associated UDS NRC error domain ([SWS_DM_00528]).
diag_uds_nrc_context diag_classes ara::diag classes nrc_exception ara::diag::DiagUdsNrcException diag_classes->nrc_exception creates and throws app Anwendungssoftware nrc_exception->app transmits error to error_code ara::core::ErrorCode error_code->nrc_exception initialisiert

Context diagram: Integration of DiagUdsNrcException in the interaction between error code, diagnostic classes, and application software. Sources: [SWS_DM_00527], [SWS_DM_00528], AUTOSAR_AP_SWS_Diagnostics §8.12.4 “Class: DiagUdsNrcException”

Lifecycle

The lifecycle of an instance of ara::diag::DiagUdsNrcException begins with its explicit instantiation by a diagnostic class or an internal error-handling routine. According to [SWS_DM_00528], the class provides a constructor explicit DiagUdsNrcException(ara::core::ErrorCode err) noexcept; that accepts the underlying error code as parameter err. This constructor is explicitly defined as exception-safe (exception safe) and non-throwing (noexcept) ([SWS_DM_00528]), which guarantees that no secondary exceptions can occur during object creation in the error path. In addition, creation is classified as thread-safe (thread-safe) according to [SWS_DM_00528]. After creation, the exception instance is typically thrown by value via the C++ runtime system. Ownership of the object remains with the runtime environment during stack unwinding until the exception is bound and evaluated in an appropriate catch block. When leaving the exception-handling block, the lifecycle of the object ends through regular destruction.

Usage Path

The typical usage path comprises the detection of a UDS NRC error, the creation of the exception, and its subsequent evaluation by the application:
  1. An application component invokes a diagnostic function or service interface of a ara::diag class.
  2. During processing, the diagnostic class determines that the request cannot be serviced successfully and a UDS NRC is present, whereupon it creates a corresponding ara::core::ErrorCode.
  3. Passing this error code, exception ara::diag::DiagUdsNrcException is instantiated via its constructor ([SWS_DM_00528]).
  4. The diagnostic class throws the exception object out of the execution context (AUTOSAR_AP_SWS_Diagnostics §8.12.4 “Class: DiagUdsNrcException”).
  5. The calling application catches the exception either specifically by type as ara::diag::DiagUdsNrcException ([SWS_DM_00527]) or polymorphically via base class ara::core::Exception and accesses the error information.
Exception handling sequence with DiagUdsNrcExceptionApplicationDiag-KlasseDiagUdsNrcExceptionExecute diagnostic functionUDS-NRC-Bedingung erkannt, ErrorCode erzeugtDiagUdsNrcException(err)throw DiagUdsNrcExceptioncatch and evaluate error

Sequence diagram: Typical creation, throw, and catch sequence of DiagUdsNrcException. Sources: [SWS_DM_00527], [SWS_DM_00528], AUTOSAR_AP_SWS_Diagnostics §8.12.4 “Class: DiagUdsNrcException”

Error Scenarios

Since ara::diag::DiagUdsNrcException is itself a vehicle for error signaling, error scenarios primarily relate to robustness and concurrency during exception creation:
  • Robust object creation: Due to its specification as noexcept and exception safe ([SWS_DM_00528]), throwing a secondary exception during construction is ruled out. This prevents fatal runtime aborts such as std::terminate in critical error-handling paths.
  • Validity of the error code: As a precondition for instantiation, a valid ara::core::ErrorCode must be available ([SWS_DM_00528]). This typically originates from the error domain defined by ara/diag/diag_uds_nrc_error_domain.h.
  • Parallel diagnostic processing: Because the constructor is specified as thread-safe ([SWS_DM_00528]), multiple threads may create diagnostic exceptions concurrently without race conditions occurring during initialization of the exception object.

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

UML class diagram

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

G nara__diag__DiagUdsNrcException343 DiagUdsNrcException + DiagUdsNrcException() nara__core__Exception792 Exception nara__diag__DiagUdsNrcException343->nara__core__Exception792 nstd__exception10 std::exception nara__core__Exception792->nstd__exception10

Constructors and destructor

Construct a new DiagException from an ErrorCode.

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

Method documentation

function DiagUdsNrcException [SWS_DM_00528] Upstream: RS_AP_00119

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

Construct a new DiagException from an ErrorCode.

Header-Datei#include "ara/diag/diag_uds_nrc_error_domain.h"
Scopeclass ara::diag::DiagUdsNrcException
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_00528
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00528@rel:R25-11#d0877d83
Content hash
d0877d83
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00528
Status: valid/unmigrated Version: rel:R25-11#55ae2ae1 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_00528@rel:R25-11#55ae2ae1
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#d0877d832026-09-30
  • R20-11rel:R20-11#cfe41a2e2026-10-14
  • R21-11rel:R21-11#cfe41a2e2026-10-14
  • R22-11rel:R22-11#b5842e552026-10-14
  • R23-11rel:R23-11#ccbb9a702026-10-14
  • R24-11rel:R24-11#55ae2ae12026-10-14
  • R25-11rel:R25-11#55ae2ae12026-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