类 ara::per::PerErrorDomain
[SWS_PER_00312] Upstream: RS_AP_00122 , RS_AP_00127 , RS_AP_00140
class PerErrorDomain final : public ara::core::ErrorDomain {...};
Defines the error domain for Persistency.
用户指南人工智能生成 定义持久化模块的错误域,用于提供错误代码、文本描述和异常。
AI 生成
未审核
模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: da81ed3d3cb6
来源
未决问题(1)
摘要 详细
定义持久化模块的错误域,用于提供错误代码、文本描述和异常。
类 ara::per::PerErrorDomain 为持久化模块定义错误域,并将错误代码与描述性消息以及异常类型相关联 [SWS_PER_00411] 。它通过线程安全的接口实现对域名以及将错误描述解析为具体错误值的查询。需要时,它通过 ThrowAsException() 将错误转换为 C++ 异常 [SWS_PER_00350] 。如果在编译器工具链中禁用了异常,则该抛出功能不可用,因此必须完全基于返回值进行错误检查。
更多 ›
上下文
类 ara::per::PerErrorDomain 定义了 AUTOSAR Adaptive Platform 内持久化模块(Persistency )的专用错误域。它继承自基类型定义 ara::core::ErrorDomain 并声明为 final,从而为所有与持久化相关的操作的类型化错误处理和错误映射构成了基础。通过针对底层错误代码枚举 PerErrc 的标准化类型别名 Errc [SWS_PER_00411] 以及针对模块特定异常基类 PerException 的 Exception [SWS_PER_00412] ,该类将数值错误值、易读的错误消息和具体的 C++ 异常对象关联起来。在平台架构中,该错误域与持久化服务、调用方功能集群以及来自 ara::core 的通用错误与结果结构紧密交互。
生命周期
实例的创建通过标准构造函数 PerErrorDomain() [SWS_PER_00313] 进行。该构造函数声明为 noexcept,完全异常安全(exception safe )且线程安全(thread-safe )。解释:PerErrorDomain 的实例通常应作为长寿命或全局对象进行管理,以确保在整个运行期间对持久化错误进行一致的域比较和类型解析。 问题 Q-5d90982fddec40a7 (未决) 由于该类的所有查询操作同样被归类为线程安全,因此多个线程可以并行访问同一个域实例,而无需在调用方级别使用额外的同步机制。
使用路径
典型的使用路径包括识别域、查询易懂的诊断信息,以及在持久化模块中发生错误时可选地抛出异常。首先,成员函数 Name() 以字符串形式返回错误域的唯一标识符 [SWS_PER_00314] ;它被指定为 noexcept、异常安全且线程安全。如果在持久化操作期间发生错误,则通过 Message() 解析其数值错误值 [SWS_PER_00315] 。该方法接收 CodeType 类型的数值错误代码,并作为常量字符指针(const char *)返回相关的错误消息,同样保证完全的异常安全性和线程安全性。
如果要将错误状态转换为 C++ 异常,则使用函数 ThrowAsException() [SWS_PER_00350] 。以下流程阐明了错误查询和异常抛出时的相互作用:
PerErrorDomain 中的错误查询与异常抛出 应用 PersistenzLaufzeit PerErrorDomain 执行持久化操作() 返回错误代码 / Result Message(errorCode) const char * (Fehlernachricht) opt 需要异常处理 ThrowAsException(errorCode) throw PerException
时序图:通过 PerErrorDomain 进行错误检查、文本查询和异常抛出的典型流程。来源:[SWS_PER_00314]、[SWS_PER_00315]、[SWS_PER_00350]。
错误场景
在实际使用 ara::per::PerErrorDomain 时,开发人员必须考虑有关错误处理和异常安全性的不同保证。虽然查询接口 Name() [SWS_PER_00314] 和 Message() [SWS_PER_00315] 严格声明为 noexcept 并归类为异常安全,但成员函数 ThrowAsException() 被视为非异常安全(not exception safe )[SWS_PER_00350] 。这种行为在语义上是有充分理由的,因为该函数的目的在于受控抛出与错误代码相对应的异常(noexcept(false))。
一个关键的约束条件涉及未启用 C++ 异常的平台或构建配置:如果在编译器中禁用了异常处理,则根据 [SWS_PER_00350] ,ThrowAsException() 不参与重载解析。在这样的环境中,应用软件必须借助于通过提供的别名 Errc [SWS_PER_00411] 和 Message() [SWS_PER_00315] 的文本描述来评估错误代码,而不是捕获 Exception [SWS_PER_00412] 类型的异常对象。
本指南基于 AUTOSAR 规范要求自动生成。
分组依据 类别 历史
成员图 类图 Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.
G
nara__per__PerErrorDomain979
PerErrorDomain
+ PerErrorDomain()
+ Message()
+ Name()
+ ThrowAsException()
nara__core__ErrorDomain335
ErrorDomain
nara__per__PerErrorDomain979->nara__core__ErrorDomain335
详细视图 此版本没有元素数据
构造函数和析构函数 Creates a PerErrorDomain instance.
PerErrorDomain () noexcept;
方法 Returns the message associated with the error code.
const char * Message (CodeType errorCode) const noexcept override;
Returns the name of the error domain.
const char * Name () const noexcept override;
Throws the exception associated with the error code. As per [SWS_CORE_10304], this function does not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain.
类型别名 Alias for the error code value enumeration.
Alias for the exception base class.
点击条目以查看其关系。
基类 派生类 使用 被使用于 继承 自此版本起移除 用于 此类中无关联 函数 AI 评注 打开类页面 无法加载类页面。 调整顺序 调整宽度 调整大纲宽度 章节 阅读时间 SWS 引用 图表 放回中间 调整顺序或拖到标题栏 取消停靠 – 在内容中显示 移到中间栏 作为标签停靠到标题栏 元素 AI 模型 打开审计档案 档案 打开简短版本 打开中等版本 打开完整版本 恢复默认视图 已恢复默认视图 撤销 关闭详细视图 签名 基本信息 值 截至所选版本的最后一次更改 之后的下一次更改 单击:选择版本 无法放在此处:拖到标题栏可停靠,拖到中间栏可取消停靠。 新增 已更改 未更改 已移除 未包含 更改 内容无变化 首次出现于 移除于 没有可用的版本数据。 正在加载版本数据 … 文本 此版本未收录措辞 悬停或单击单元格:与所选版本比较 · 单击版本标题:选择版本 选择版本 属性 版本 元素 只有一个版本有措辞 PDF 中存在,原文尚未导入 首次采集原文 自 {rel} 起未更改 版本颜色 最早版本 最新版本
方法文档
const char * Message (CodeType errorCode) const noexcept override;
Returns the message associated with the error code.
Header-Datei #include "ara/per/per_error_domain.h" Scope class ara::per::PerErrorDomain Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Parameter (in)
Parameter Beschreibung errorCode The error code number.
Rückgabewert
Typ Beschreibung const char * The message associated with the error code.
Status: valid/unmigrated
Version: rel:R25-11#b3b0e84a
Versionshistorie & Revisions (1 transition, 8 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_PER_00315@rel:R25-11#b3b0e84a
Point-in-Time History:
Release:
R25-11 (Current / Active) R19-11 R20-11 R21-11 R22-11 R23-11 R24-11
View Snapshot
Recorded Revisions (8):
R25-11 rel:R25-11#dcf865cc2026-09-30 Inspect R19-11 rel:R19-11#fa40c0592026-10-14 Inspect R20-11 rel:R20-11#482223252026-10-14 Inspect R21-11 rel:R21-11#4762f8102026-10-14 Inspect R22-11 rel:R22-11#03cd14022026-10-14 Inspect R23-11 rel:R23-11#d69d63782026-10-14 Inspect R24-11 rel:R24-11#b3b0e84a2026-10-14 Inspect R25-11 rel:R25-11#b3b0e84a2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
const char * Name () const noexcept override;
Returns the name of the error domain.
Header-Datei #include "ara/per/per_error_domain.h" Scope class ara::per::PerErrorDomain Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Rückgabewert
Status: valid/unmigrated
Version: rel:R25-11#bbc9c834
Versionshistorie & Revisions (1 transition, 8 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_PER_00314@rel:R25-11#bbc9c834
Point-in-Time History:
Release:
R25-11 (Current / Active) R19-11 R20-11 R21-11 R22-11 R23-11 R24-11
View Snapshot
Recorded Revisions (8):
R25-11 rel:R25-11#8efa8b412026-09-30 Inspect R19-11 rel:R19-11#157f07862026-10-14 Inspect R20-11 rel:R20-11#578706942026-10-14 Inspect R21-11 rel:R21-11#578706942026-10-14 Inspect R22-11 rel:R22-11#7e3ba2a72026-10-14 Inspect R23-11 rel:R23-11#4ed7a81d2026-10-14 Inspect R24-11 rel:R24-11#f4d2bd532026-10-14 Inspect R25-11 rel:R25-11#bbc9c8342026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
PerErrorDomain () noexcept;
Creates a PerErrorDomain instance.
Header-Datei #include "ara/per/per_error_domain.h" Scope class ara::per::PerErrorDomain Exception-Sicherheit exception safe Thread-Sicherheit thread-safe
Status: valid/unmigrated
Version: rel:R25-11#676bd5fe
Versionshistorie & Revisions (1 transition, 8 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_PER_00313@rel:R25-11#676bd5fe
Point-in-Time History:
Release:
R25-11 (Current / Active) R19-11 R20-11 R21-11 R22-11 R23-11 R24-11
View Snapshot
Recorded Revisions (8):
R25-11 rel:R25-11#2fe03ca62026-09-30 Inspect R19-11 rel:R19-11#493784652026-10-14 Inspect R20-11 rel:R20-11#e90ad4282026-10-14 Inspect R21-11 rel:R21-11#4fed90922026-10-14 Inspect R22-11 rel:R22-11#c86bdbe02026-10-14 Inspect R23-11 rel:R23-11#07bddb402026-10-14 Inspect R24-11 rel:R24-11#676bd5fe2026-10-14 Inspect R25-11 rel:R25-11#676bd5fe2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
void ThrowAsException (const ara::core::ErrorCode &errorCode) const noexcept(false) override;
Throws the exception associated with the error code. As per [SWS_CORE_10304] , this function does not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain.
Header-Datei #include "ara/per/per_error_domain.h" Scope class ara::per::PerErrorDomain Exception-Sicherheit not exception safe Thread-Sicherheit thread-safe
Parameter (in)
Parameter Beschreibung errorCode The error to throw.
Rückgabewert
Status: valid/unmigrated
Version: rel:R25-11#d5cad670
Versionshistorie & Revisions (1 transition, 8 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_PER_00350@rel:R25-11#d5cad670
Point-in-Time History:
Release:
R25-11 (Current / Active) R19-11 R20-11 R21-11 R22-11 R23-11 R24-11
View Snapshot
Recorded Revisions (8):
R25-11 rel:R25-11#ac2c50332026-09-30 Inspect R19-11 rel:R19-11#08d8b5132026-10-14 Inspect R20-11 rel:R20-11#bcef1c2f2026-10-14 Inspect R21-11 rel:R21-11#bcef1c2f2026-10-14 Inspect R22-11 rel:R22-11#855e1f712026-10-14 Inspect R23-11 rel:R23-11#a44240ed2026-10-14 Inspect R24-11 rel:R24-11#d5cad6702026-10-14 Inspect R25-11 rel:R25-11#d5cad6702026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
类型别名文档
using Errc = PerErrc ;
Alias for the error code value enumeration.
Status: valid/unmigrated
Version: rel:R25-11#9d0ddf8d
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_PER_00411@rel:R25-11#9d0ddf8d
Point-in-Time History:
Release:
R25-11 (Current / Active) R20-11 R21-11 R22-11 R23-11 R24-11 R19-11
View Snapshot
Recorded Revisions (7):
R25-11 rel:R25-11#78fe22022026-09-30 Inspect R20-11 rel:R20-11#39e744882026-10-14 Inspect R21-11 rel:R21-11#39e744882026-10-14 Inspect R22-11 rel:R22-11#8f96934a2026-10-14 Inspect R23-11 rel:R23-11#9d0ddf8d2026-10-14 Inspect R24-11 rel:R24-11#9d0ddf8d2026-10-14 Inspect R25-11 rel:R25-11#9d0ddf8d2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
using Exception = PerException ;
Alias for the exception base class.
Status: valid/unmigrated
Version: rel:R25-11#12539c4d
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_PER_00412@rel:R25-11#12539c4d
Point-in-Time History:
Release:
R25-11 (Current / Active) R20-11 R21-11 R22-11 R23-11 R24-11 R19-11
View Snapshot
Recorded Revisions (7):
R25-11 rel:R25-11#0875fcdc2026-09-30 Inspect R20-11 rel:R20-11#e88607572026-10-14 Inspect R21-11 rel:R21-11#e88607572026-10-14 Inspect R22-11 rel:R22-11#b0bd04f32026-10-14 Inspect R23-11 rel:R23-11#12539c4d2026-10-14 Inspect R24-11 rel:R24-11#12539c4d2026-10-14 Inspect R25-11 rel:R25-11#12539c4d2026-10-14 active Inspect
Historical Snapshot:
× Back to current
🚫
Requirement entfallen: Dieses Element ist im gewählten Release nicht mehr enthalten.
Requirement Text as-of this release:
Reachable Artifacts & Dependents:
Date Actor Transition Reason / Rationale Campaign
2026-08-13 tool none → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record 2026-08-13-status-backfill
gemini-3.8-flash-low· 2026-10-13 · 德文原文