DEENESPTFRRUARHIKOZHNL

class ara::com::ComException

[SWS_CM_11327] Upstream: RS_AP_00130, RS_AP_00122, RS_AP_00127

class ComException final :            public ara::core::Exception {...};

Defines a class for exceptions to be thrown by the API.

Header-Datei#include "ara/com/com_error_domain.h"
Forwarding-Header#include "ara/com/com_fwd.h"
Scopenamespace ara::com
Basisklasse(n)ara::core::Exception

User GuideAI-GENERATED

Serves as an API exception class for encapsulating and reporting communication management errors via error codes.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: becb2133e102 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves as an API exception class for encapsulating and reporting communication management errors via error codes.

The class ara::com::ComException serves in AUTOSAR Adaptive as the central exception class for signaling errors during calls to the communication API [SWS_CM_11327]. It encapsulates an ara::core::ErrorCode and is instantiated and thrown on failed operations, with its constructor defined as exception-safe and non-throwing [SWS_CM_11328]. If C++ exceptions are disabled in the compiler toolchain, the corresponding throwing API overloads are completely omitted from overload resolution. Callers catch the exception object to analyze the contained error code and initiate error handling actions.

Context

The class ara::com::ComException serves in the com module of the AUTOSAR Adaptive Platform as a specialized exception class for signaling errors during calls to the communication API [SWS_CM_11327]. It publicly derives from the base class ara::core::Exception and is declared as final. This illustrates the direct integration into the overall error handling architecture of the Adaptive Platform. By being marked as final, the class is likely designed as a final exception type that is not intended for a further derivation hierarchy. Question Q-2454b5b73295287b (open)

The primary purpose of ara::com::ComException is to encapsulate an occurred error state in the form of an ara::core::ErrorCode and transmit it to calling layers via the C++ exception mechanism [SWS_CM_11328]. The declaration and definition are provided via header #include "ara/com/com_error_domain.h" [SWS_CM_11328]. The using application software, the internal service and API functions of communication management, and the types of the error domain ara::core::ErrorCode act as the central interaction partners.

Lifecycle

The lifecycle of an ara::com::ComException object begins in the implementation of an API function of communication management as soon as an operation fails and the exception is instantiated and thrown AUTOSAR_AP_SWS_CommunicationManagement §8.12.5 “Class: ComException”. Creation takes place via the explicit constructor, which takes the triggering ara::core::ErrorCode object [SWS_CM_11328].

This constructor is declared with noexcept and has the property exception safe [SWS_CM_11328]. This guarantees that no further exceptions can occur during construction of the exception object itself. After being thrown via throw, the object is transported during stack unwinding until it is bound in a matching catch block of the calling layer. Regarding ownership, the instance is automatically destroyed on the stack after leaving the handling block. The class does not exhibit internal state transitions in the sense of a state machine; its state remains immutable after initialization with the error code.

Usage Path

The typical usage path describes the sequence of error detection, exception throwing, and subsequent handling:

  1. An application function calls an operation of the ara::com interface.
  2. If an error occurs during processing, the API implementation creates a new instance of ara::com::ComException from the associated errorCode and throws it AUTOSAR_AP_SWS_CommunicationManagement §8.12.5 “Class: ComException”.
  3. The application catches the exception in a matching block. Catching on the application side is presumably done by const reference (const ara::com::ComException&) to avoid copy operations. Question Q-5270e026eeac8be7 (open)
  4. Via the base class interface, the caller accesses the contained ara::core::ErrorCode and performs diagnostic or compensation steps [SWS_CM_11328].
Sequence of exception handling with ComExceptionApplicationara::com-LaufzeitComExceptionExecute API call()Kommunikationsfehler erkanntComException(errorCode) instanziierenthrow ComExceptioncatch (const ara::com::ComException&) and evaluate error code

Sequence diagram: Process of error detection, instantiation, and handling of ara::com::ComException. Sources: [SWS_CM_11327], [SWS_CM_11328], AUTOSAR_AP_SWS_CommunicationManagement §8.12.5 “Class: ComException”

Error Scenarios

In the context of error handling and toolchain configuration, the following conditions and corner cases apply:

  • Disabled C++ exceptions: If C++ exceptions are disabled in the compiler toolchain, API functions that create and throw ara::com::ComException do not participate in overload resolution according to [SWS_CORE_10304] AUTOSAR_AP_SWS_CommunicationManagement §8.12.5 “Class: ComException”. In this case, the error-handling software relies on alternative return mechanisms.
  • Constructor type safety: Since the constructor is declared as explicit, implicit type conversions when passing the ara::core::ErrorCode are prevented [SWS_CM_11328].
  • Hierarchical catching: Because ara::com::ComException inherits from ara::core::Exception, callers can handle exceptions either specifically as ara::com::ComException or generally via handlers for the base class.

This guide is based on the AUTOSAR Adaptive R25-11 specification. All statements and references rely exclusively on the provided specification excerpts.

UML class diagram

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

G nara__com__ComException152 ComException + ComException() nara__core__Exception792 Exception nara__com__ComException152->nara__core__Exception792 nstd__exception10 std::exception nara__core__Exception792->nstd__exception10

Constructors and destructor

ComException function

Constructs a new ara::com::ComException containing an ara::core::ErrorCode

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

Method documentation

function ComException [SWS_CM_11328] Upstream: RS_AP_00120, RS_AP_00121, RS_AP_00130

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

Constructs a new ara::com::ComException containing an ara::core::ErrorCode

Header-Datei#include "ara/com/com_error_domain.h"
Scopeclass ara::com::ComException
Exception-Sicherheitexception 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_CM_11328
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11328@rel:R25-11#ffcd7502
Content hash
ffcd7502
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11328
Status: valid/unmigrated Version: rel:R25-11#5e7d893a 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_CM_11328@rel:R25-11#5e7d893a
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#ffcd75022026-09-30
  • R20-11rel:R20-11#4a6338102026-10-14
  • R21-11rel:R21-11#4a6338102026-10-14
  • R22-11rel:R22-11#17139dec2026-10-14
  • R23-11rel:R23-11#41e9e0262026-10-14
  • R24-11rel:R24-11#94963f6e2026-10-14
  • R25-11rel:R25-11#5e7d893a2026-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