DEENESPTFRRUARHIKOZHNL

类 ara::com::ComErrorDomain

[SWS_CM_11329] Upstream: RS_AP_00130, RS_AP_00122, RS_AP_00127

class ComErrorDomain final :            public ara::core::ErrorDomain {...};

Defines a class representing the Communication error domain.

Header-Datei#include "ara/com/com_error_domain.h"
Forwarding-Header#include "ara/com/com_fwd.h"
Scopenamespace ara::com
Basisklasse(n)ara::core::ErrorDomain
Unique IDAs per ara::com::ComErrorDomain in [SWS_CORE_90023]

用户指南人工智能生成

封装并标识中间件的通用通信错误,以实现标准化错误处理。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 13073fe45989 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

封装并标识中间件的通用通信错误,以实现标准化错误处理。

类 ara::com::ComErrorDomain 表示通信错误域,用于标识 ara::com API 中的通用、非接口特定错误([SWS_CM_11265])。它为诸如 ComErrc::kCommunicationFailure 之类的错误代码提供错误描述,并允许通过 Message() 查询这些描述或通过 ThrowAsException() 将其转换为异常([SWS_CM_11332])。由于其默认构造函数已被删除,因此它充当承载错误 ara::core::Result 的无状态、线程安全域实例。

上下文

类 ara::com::ComErrorDomain 表示 Adaptive Platform 针对功能集群 Communication Management 的标准化通信错误域(SWS CommunicationManagement 第439页)。它派生自基类 ara::core::ErrorDomain,并定义了在方法调用或数据传输过程中可能发生但非单个 ServiceInterface 特有的通用错误的语义上下文([SWS_CM_11265])。在 ara::com 的错误架构中,它将常规通信故障与 E2E 监控错误以及应用程序特定的服务错误进行系统性区分(SWS CommunicationManagement §7.5.22.6 “Error Related Data Types”)。

其核心交互伙伴包括 Adaptive Application、中间件的服务和代理实现以及基础系统的 ara::core::ErrorCode 和 ara::core::Result 数据类型(EXP ARAComAPI §4.7 “Error Handling”)。对于语义类型绑定,该类为错误代码枚举 ComErrc 提供类型别名 Errc([SWS_CM_11336]),并为相应的异常类 ComException 提供类型别名 Exception([SWS_CM_11337])。

ComErrorDomainContext app Adaptive Application runtime ara::com Middleware app->runtime 调用服务 domain ara::com::ComErrorDomain app->domain fragt Name / Message ab runtime->app 返回 Result errorcode ara::core::ErrorCode / Result runtime->errorcode erzeugt base ara::core::ErrorDomain domain->base erbt von errorcode->domain referenziert

上下文图:ComErrorDomain 在 ara::com 错误架构中的归属。来源:[SWS_CM_11265]、EXP ARAComAPI §4.7 “Error Handling”、SWS CommunicationManagement §7.5.22.6 “Error Related Data Types”

生命周期

作为错误域的规范类,ara::com::ComErrorDomain 通过删除默认构造函数 ComErrorDomain() = delete; 来阻止其实例创建([SWS_CM_11330])。解释:域实例的提供可能通过平台作为静态单例进行,因此应用程序组件无需动态实例化或管理该域。 问题 Q-bf957a108c0a5378 (未决)

该实例充当无状态描述符,不包含可变属性。所有提供的方法(例如 Name()([SWS_CM_11331])和 Message()([SWS_CM_11332]))均被声明为 const noexcept。这确保了在并行应用程序和中间件线程进行并发错误查询时具有完全的线程安全性。

使用路径

典型的使用路径包括通过 ara::com 的接口检测、传输和评估错误:

  1. 应用程序发起服务交互,例如通过方法类 operator() 的调用运算符([SWS_CM_00196])。
  2. 如果中间件在处理过程中检测到错误情况(例如通信故障或未配置的应用程序错误 [SWS_CM_00048]),则会在相应的 Promise 上调用操作 SetError(SWS CommunicationManagement 第300页)。
  3. 此时构造一个 ara::core::ErrorCode,其域设置为 ara::com::ComErrorDomain([SWS_CM_11329]),其数值代码设置为特定的枚举值(例如 ComErrc::kCommunicationFailure)([SWS_CM_10432])。
  4. 返回给应用程序的 ara::core::Future 或 ara::core::Result 在错误状态下将错误代码传递给调用者(EXP ARAComAPI §4.7 “Error Handling”)。
  5. 应用程序检查 Result 并利用域函数 Name()([SWS_CM_11331])和 Message()([SWS_CM_11332])来解析用于记录或诊断的错误消息。
  6. 如果应用程序逻辑需要异常且已启用 C++ 异常,则可以通过 ThrowAsException() 触发转换为 ComException([SWS_CM_11333])。
通过 ComErrorDomain 进行错误指示与查询ApplicationService Methodara::com RuntimeComErrorDomainoperator()()执行服务调用Kommunikationsfehler erkanntSetError(ErrorCode)带 ErrorCode 的 ResultMessage(errorCode)const char* Fehlermeldung

时序图:通过 ComErrorDomain 发出通信错误信号并进行查询。来源:[SWS_CM_00196]、[SWS_CM_10432]、[SWS_CM_11329]、[SWS_CM_11332]、SWS CommunicationManagement 第300页

错误场景

ara::com 的错误概念严格区分可恢复错误(Recoverable Errors)与严重编程违规(Violations 或 Corruptions)(EXP ARAComAPI §4.7 “Error Handling”)。可恢复错误通过 ara::core::Result 和 ara::core::ErrorCode 处理,其中域 ComErrorDomain 的错误代码通过标识符别名 Errc 进行寻址([SWS_CM_11336])。

例如,如果在远程调用期间发生传输中断,系统将报告 ComErrc::kCommunicationFailure([SWS_CM_10432])。在出现未配置的应用程序错误时,中间件将中止调用,并同样设置该域的相应错误代码([SWS_CM_00048]、SWS CommunicationManagement 第300页)。

如果要将错误代码作为异常抛出,ThrowAsException() 将实例化类型为 ComException 的异常([SWS_CM_11337])并将其抛出([SWS_CM_11333])。该方法不是异常安全的(not exception safe),并且根据规范,在禁用 C++ 异常时不参与重载解析([SWS_CM_11333])。相反,不可恢复的系统违规将直接导致平台中止,并且不通过 ComErrorDomain 处理(EXP ARAComAPI §4.7 “Error Handling”)。

本指南由 AI 基于 AUTOSAR 规范 R25-11 编写。

成员图

构造函数和析构函数

1

类型别名

2

类图

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

G nara__com__ComErrorDomain658 ComErrorDomain + ComErrorDomain() + Message() + Name() + ThrowAsException() nara__core__ErrorDomain335 ErrorDomain nara__com__ComErrorDomain658->nara__core__ErrorDomain335

详细视图

请在大纲中选择一个条目。

构造函数和析构函数

Constructs a new ara::com::ComErrorDomain object

ComErrorDomain ()=delete;

方法

Message 函数

Returns the message associated with errorCode

const char * Message (CodeType errorCode) const noexcept override;
Name 函数

Returns a string constant associated with the ara::com::ComErrorDomain

const char * Name () const noexcept override;

Creates a new instance of ara::com::ComException from errorCode and throws it. As per [SWS_CORE_10304], this function does not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain.

void ThrowAsException (const ara::core::ErrorCode &errorCode) const noexcept(false) override;

类型别名

Errc 类型别名

Alias for the error code value enumeration

using Errc = ComErrc;
Exception 类型别名

Alias for the exception base class

方法文档

函数 ComErrorDomain [SWS_CM_11330] Upstream: RS_AP_00120, RS_AP_00130

ComErrorDomain ()=delete;

Constructs a new ara::com::ComErrorDomain object

Header-Datei#include "ara/com/com_error_domain.h"
Scopeclass ara::com::ComErrorDomain

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

Record
AUTOSAR/AP/record/SWS_CM_11330
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11330@rel:R25-11#cff097e4
Content hash
cff097e4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11330
Status: valid/unmigrated Version: rel:R25-11#311df5be 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_11330@rel:R25-11#311df5be
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#ac718eaf2026-09-30
  • R20-11rel:R20-11#29b64c1a2026-10-14
  • R21-11rel:R21-11#29b64c1a2026-10-14
  • R22-11rel:R22-11#9ed8561d2026-10-14
  • R23-11rel:R23-11#87bee04d2026-10-14
  • R24-11rel:R24-11#311df5be2026-10-14
  • R25-11rel:R25-11#311df5be2026-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

函数 Message [SWS_CM_11332] Upstream: RS_AP_00120, RS_AP_00121, RS_AP_00130

const char * Message (CodeType errorCode) const noexcept override;

Returns the message associated with errorCode

Header-Datei#include "ara/com/com_error_domain.h"
Scopeclass ara::com::ComErrorDomain
Exception-Sicherheitexception safe

Parameter (in)

ParameterBeschreibung
errorCodeThe error code number.

Rückgabewert

TypBeschreibung
const char *The message associated with the errorCode

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

Record
AUTOSAR/AP/record/SWS_CM_11332
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11332@rel:R25-11#12c91161
Content hash
12c91161
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11332
Status: valid/unmigrated Version: rel:R25-11#7bdb7850 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_11332@rel:R25-11#7bdb7850
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#6543769f2026-09-30
  • R20-11rel:R20-11#b09f8a972026-10-14
  • R21-11rel:R21-11#b09f8a972026-10-14
  • R22-11rel:R22-11#38e51ca02026-10-14
  • R23-11rel:R23-11#684722932026-10-14
  • R24-11rel:R24-11#9ea8ac0d2026-10-14
  • R25-11rel:R25-11#7bdb78502026-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

函数 Name [SWS_CM_11331] Upstream: RS_AP_00120, RS_AP_00130

const char * Name () const noexcept override;

Returns a string constant associated with the ara::com::ComErrorDomain

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 4c51965f3a93 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

类 ara::com::ComErrorDomain 的成员函数 Name() 用于标准化获取该错误域的文本标识([SWS_CM_11331])。调用以同步方式进行,不需要传入参数,并返回一个指向关联字符串的 const char * 类型常量指针([SWS_CM_11331])。返回字符串的具体表示取决于 [SWS_CORE_90023] 中针对 ara::com::ComErrorDomain 的规定。该声明须通过头文件 ara/com/com_error_domain.h 包含([SWS_CM_11331])。

错误处理与并发

该方法带有规范 noexcept 并被归类为异常安全(exception safe)([SWS_CM_11331])。在发生错误时,既不会抛出异常,也不会返回特定的错误码,因为这是一个纯读取操作。由于仅寻址不可变字符串常量,因此该方法大概率是可重入的,并能够在无需外部同步的情况下安全支持来自多个线程的并发调用。 问题 Q-a9f6ae55558ebb1f (未决)

相互作用

该函数是通信管理(AUTOSAR_AP_SWS_CommunicationManagement §1 “Change History”)内标准化错误域标识符的组成部分。名称和接口方案在各相关域中是一致实现的:端到端错误域 ara::com::e2e::ComE2EErrorDomain 通过 [SWS_CM_12507],以及 SecOC-FVM 错误域 apext::com::secoc::ComSecOcFvmErrorDomain 通过 [SWS_CM_12518],也都定义了类似的 Name() 方法用于标识。

此文本由 AI 基于 AUTOSAR 规范生成。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/com/com_error_domain.h"
Scopeclass ara::com::ComErrorDomain
Exception-Sicherheitexception safe

Rückgabewert

TypBeschreibung
const char *As per ara::com::ComErrorDomain in [SWS_CORE_90023]

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

Record
AUTOSAR/AP/record/SWS_CM_11331
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11331@rel:R25-11#de2a56ab
Content hash
de2a56ab
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11331
Status: valid/unmigrated Version: rel:R25-11#f830d6b9 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_11331@rel:R25-11#f830d6b9
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#63ce88742026-09-30
  • R20-11rel:R20-11#a9004e6e2026-10-14
  • R21-11rel:R21-11#a9004e6e2026-10-14
  • R22-11rel:R22-11#b910a94e2026-10-14
  • R23-11rel:R23-11#71a3f6172026-10-14
  • R24-11rel:R24-11#c88a65792026-10-14
  • R25-11rel:R25-11#f830d6b92026-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

函数 ThrowAsException [SWS_CM_11333] Upstream: RS_AP_00120, RS_AP_00121, RS_AP_00130

void ThrowAsException (const ara::core::ErrorCode &errorCode) const noexcept(false) override;

Creates a new instance of ara::com::ComException from errorCode and throws it. As per [SWS_CORE_10304], this function does not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: bc30613084e7 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

错误域 ara::com::ComErrorDomain([SWS_CM_11333];SWS CommunicationManagement §8.12.4.2.2.3 “ThrowAsException”)的成员函数 ThrowAsException 从传入的错误码 errorCode(类型为 const ara::core::ErrorCode&)同步生成异常 ara::com::ComException 的实例并立即将其抛出。该接口没有返回值(void),并通过头文件 ara/com/com_error_domain.h 进行声明。

错误处理与异常安全性

该签名声明为 noexcept(false),并被指定为非异常安全(not exception safe)([SWS_CM_11333]),因为引发异常是该函数的主要目的。未为此调用定义特定的 DET 或 DEM 报告。

边界条件与限制

核心边界条件为:如果编译器工具链中禁用了 C++ 异常,则根据 [SWS_CORE_10304],该函数不参与重载解析([SWS_CM_11333])。解释:在禁用了异常处理的软件架构中,该函数在编译时大概率不可调用。 问题 Q-437f825160e6801e (未决)

相互作用

该函数与通信管理相关错误域的同名方法相对应,例如针对 ara::com::e2e::ComE2EException 的 ara::com::e2e::ComE2EErrorDomain::ThrowAsException([SWS_CM_12509];SWS CommunicationManagement §8.15.3.2.2.3 “ThrowAsException”)以及针对 apext::com::secoc::ComSecOcFvmException 的 apext::com::secoc::ComSecOcFvmErrorDomain::ThrowAsException([SWS_CM_12520];SWS CommunicationManagement §C.2.3.2.2.3 “ThrowAsException”)。

本使用说明由 AI 基于 AUTOSAR Adaptive R25-11 规范生成。

实现者指南即将推出(复杂度 I2)

Header-Datei#include "ara/com/com_error_domain.h"
Scopeclass ara::com::ComErrorDomain
Exception-Sicherheitnot exception safe

Parameter (in)

ParameterBeschreibung
errorCodeThe error to throw.

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_CM_11333
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11333@rel:R25-11#e4ed2218
Content hash
e4ed2218
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11333
Status: valid/unmigrated Version: rel:R25-11#ca2e1034 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_11333@rel:R25-11#ca2e1034
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#08f757e52026-09-30
  • R20-11rel:R20-11#cfb82fec2026-10-14
  • R21-11rel:R21-11#cfb82fec2026-10-14
  • R22-11rel:R22-11#c01d94f82026-10-14
  • R23-11rel:R23-11#b004bb3f2026-10-14
  • R24-11rel:R24-11#08bab0d22026-10-14
  • R25-11rel:R25-11#ca2e10342026-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

类型别名文档

类型别名 Errc [SWS_CM_11336] Upstream: RS_AP_00120, RS_AP_00130

using Errc = ComErrc;

Alias for the error code value enumeration

Header-Datei#include "ara/com/com_error_domain.h"
Scopeclass ara::com::ComErrorDomain
SymbolErrc

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

Record
AUTOSAR/AP/record/SWS_CM_11336
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11336@rel:R25-11#bd0d4fbb
Content hash
bd0d4fbb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11336
Status: valid/unmigrated Version: rel:R25-11#9dcc2b3c 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_11336@rel:R25-11#9dcc2b3c
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#1d242af82026-09-30
  • R20-11rel:R20-11#bdbb3b7b2026-10-14
  • R21-11rel:R21-11#d5b1fd782026-10-14
  • R22-11rel:R22-11#cfcb0f762026-10-14
  • R23-11rel:R23-11#6911ba582026-10-14
  • R24-11rel:R24-11#9dcc2b3c2026-10-14
  • R25-11rel:R25-11#9dcc2b3c2026-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

类型别名 Exception [SWS_CM_11337] Upstream: RS_AP_00120, RS_AP_00130

using Exception = ComException;

Alias for the exception base class

Header-Datei#include "ara/com/com_error_domain.h"
Scopeclass ara::com::ComErrorDomain
SymbolException

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

Record
AUTOSAR/AP/record/SWS_CM_11337
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CM_11337@rel:R25-11#c56ab33a
Content hash
c56ab33a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_CommunicationManagement.pdf#nameddest=SWS_CM_11337
Status: valid/unmigrated Version: rel:R25-11#261070dd 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_11337@rel:R25-11#261070dd
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#aed5e41a2026-09-30
  • R20-11rel:R20-11#3791dd7e2026-10-14
  • R21-11rel:R21-11#3791dd7e2026-10-14
  • R22-11rel:R22-11#be13c66e2026-10-14
  • R23-11rel:R23-11#e6fe4ac62026-10-14
  • R24-11rel:R24-11#261070dd2026-10-14
  • R25-11rel:R25-11#261070dd2026-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