DEENESPTFRRUARHIKOZHNL

class ara::sm::SmErrorDomain

[SWS_SM_81241] Upstream: RS_AP_00119

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

Defines the error domain for State Management.

Header-Datei#include "ara/sm/sm_error_domain.h"
Forwarding-Header#include "ara/sm/sm_fwd.h"
Scopenamespace ara::sm
Basisklasse(n)ara::core::ErrorDomain
Unique IDAs per ara::sm::SmErrorDomain in [SWS_CORE_90023]

User GuideAI-GENERATED

Used for defining and resolving error codes and exceptions within State Management.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: bb9dfd646ad0 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Used for defining and resolving error codes and exceptions within State Management.

The class ara::sm::SmErrorDomain represents the domain-specific error domain of State Management and maps functional error codes to readable text messages and C++ exceptions ([SWS_SM_81241]). At runtime, it enables domain identification and the translation of individual error values for logging and diagnostics via thread-safe methods. If a severe error occurs, a typed exception can also be thrown via the interface ([SWS_SM_81250]). If C++ exceptions are disabled in the toolchain, the exception logic is unavailable and errors must instead be processed purely on a value basis.

Context

The class ara::sm::SmErrorDomain defines the specific error domain for the State Management functional cluster on the Adaptive Platform ([SWS_SM_81241], SWS StateManagement §8.1.3 “Class: SmErrorDomain”). As a specialization of the general error domain architecture, it inherits from ara::core::ErrorDomain according to the requirements from [SWS_CORE_90023]. Its central responsibility is to semantically encapsulate State Management error states, provide standardized error identifiers, and guarantee the mapping between numerical error codes, error texts, and exception types.

Primary interaction partners include internal components of State Management that generate errors, as well as higher-level application and platform services that receive errors via ara::core::ErrorCode. Via the public type alias Errc, the class references the domain-specific enumeration SmErrc ([SWS_SM_81245]). The type alias Exception also references the associated exception base class SmException ([SWS_SM_81246], SWS StateManagement §8.1.3.1.2 “Type Alias: Exception”).

Lifecycle

Instances of ara::sm::SmErrorDomain are created via the parameterless default constructor ([SWS_SM_81247], SWS StateManagement §8.1.3.2.1.1 “Default Constructor”). The constructor is declared as noexcept and has the classification exception safe. In typical system environments, an instance of SmErrorDomain is likely to exist preferably as a long-lived or static object, since error domains are required process-wide in the AUTOSAR Adaptive ecosystem to interpret error codes. Question Q-fbf8e3e45bf0181a (open)

Regarding concurrency, the core functions of the class are specified for concurrent operation: The methods Name() ([SWS_SM_81248]) and Message() ([SWS_SM_81249]) are designated as thread-safe and exception safe. Multiple executing threads can thus query error information in parallel without requiring external synchronization.

Usage Path

The regular usage path comprises identifying the error domain, resolving error codes into readable diagnostic messages, and optionally transforming them into a C++ exception. First, an application or platform component can retrieve the domain name via Name(); this immutably returns the identifier "Sm" ([SWS_SM_81248]).

If an error occurs in State Management, its code is passed via Message(errorCode) ([SWS_SM_81249], SWS StateManagement §8.1.3.2.2.1 “Message”). The function returns a pointer to the associated string (const char*), providing logging and diagnostic systems with meaningful messages. If the calling subsystem is designed for exception-based error handling, it passes the error object to ThrowAsException() ([SWS_SM_81250]), thereby instantiating and throwing the exception corresponding to the error code.

Usage path for error resolution and throwing exceptionsApplicationSmErrorDomainSmExceptionSmErrorDomain()Instanz bereitgestelltMessage(errorCode)const char* FehlermeldungoptAusnahmebehandlung aktivThrowAsException(errorCode)wirft Ausnahme

Sequence diagram: Typical sequence when querying error information and optionally throwing an exception. Sources: [SWS_SM_81247], [SWS_SM_81248], [SWS_SM_81249], [SWS_SM_81250].

Error Scenarios

The error states managed by the domain are based on the enumeration type SmErrc, which is aliased via Errc ([SWS_SM_81245]). Error situations manifest either as return values based on ara::core::ErrorCode or via exceptions of type Exception (SmException, [SWS_SM_81246]).

When calling ThrowAsException(), the method is considered not exception safe by design, as it actively throws the exception associated with the error code ([SWS_SM_81250]). A critical precondition for the availability of this method relates to the toolchain configuration: According to [SWS_CORE_10304], ThrowAsException() does not participate in overload resolution if C++ exceptions are disabled in the compiler toolchain ([SWS_SM_81250]). In system configurations without exception support, error handling must consequently be handled strictly via return codes.

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

Member map

Constructors and destructor

1

Type aliases

2

Class diagram

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

G nara__sm__SmErrorDomain386 SmErrorDomain + SmErrorDomain() + Message() + Name() + ThrowAsException() nara__core__ErrorDomain335 ErrorDomain nara__sm__SmErrorDomain386->nara__core__ErrorDomain335

Detail view

Select an entry in the outline.

Constructors and destructor

SmErrorDomain function

Creates a SmErrorDomain instance.

SmErrorDomain () noexcept;

Methods

Message function

Returns the message associated with the error code.

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

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.

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

Type aliases

Errc type alias

Alias for the error code value enumeration.

using Errc = SmErrc;
Exception type alias

Alias for the exception base class.

Method documentation

function Message [SWS_SM_81249] Upstream: RS_AP_00119, RS_AP_00159

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

Returns the message associated with the error code.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 5c30b05c668e Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The member function ara::sm::SmErrorDomain::Message serves to synchronously determine the textual error message that is assigned to a specific error code of the State Management error domain [SWS_SM_81249]. It is declared in the header file ara/sm/sm_error_domain.h within the scope of class ara::sm::SmErrorDomain and has the status DRAFT in the specification AUTOSAR_AP_SWS_StateManagement §8.1.3.2.2.1 “Message”.

The interface has the following parameters and return values [SWS_SM_81249]:

  • Parameter: errorCode of type CodeType accepts the numerical error number for which the associated text message is requested.
  • Return value: A pointer of type const char * to the error message assigned to the passed error code.

Strict assurances regarding concurrency and exception handling apply to the execution: The function is specified as thread-safe and exception safe and is declared with the identifier noexcept [SWS_SM_81249]. It can thus be safely called from arbitrary threads without synchronizing locks or try-catch blocks.

Within the error management of AUTOSAR Adaptive, the method overrides the virtual function of the base error domain. Interpretation: Because the return value is defined as const char * without an allocation interface, the pointer is typically likely to refer to static string literals that remain valid across the entire process runtime. Question Q-03fc170f18f910b4 (open)

This note was generated by an AI based on the AUTOSAR Adaptive R25-11 specification.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopeclass ara::sm::SmErrorDomain
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
errorCodeThe error code number.

Rückgabewert

TypBeschreibung
const char *The message associated with the error code.

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

Record
AUTOSAR/AP/record/SWS_SM_81249
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81249@rel:R25-11#b28e7125
Content hash
b28e7125
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81249
Status: valid/unmigrated Version: rel:R25-11#b28e7125 Versionshistorie & Revisions (1 transition)
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_SM_81249@rel:R25-11#b28e7125
Point-in-Time History:
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

function Name [SWS_SM_81248] Upstream: RS_AP_00119, RS_AP_00159

const char * Name () const noexcept override;

Returns the name of the error domain.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: afc14722564a Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The API method Name of the error domain class ara::sm::SmErrorDomain is used to retrieve the standardized name of the State Management error domain ([SWS_SM_81248]). According to the specification, the synchronous call always returns the constant string value "Sm" (SWS StateManagement §8.1.3.2.2.2 “Name”). For use, the corresponding header file ara/sm/sm_error_domain.h must be included.

The member function takes no input parameters and provides full exception safety: It is specified as noexcept and exception safe ([SWS_SM_81248]), guaranteeing that it returns without throwing exceptions and generates no error codes. Interpretation: Since const char * with the fixed value "Sm" is specified as the return type, the function is likely to refer to a static string literal whose lifetime is unlimited. Question Q-855d1837679010a7 (open)

Regarding call context and concurrency, the method is classified as thread-safe ([SWS_SM_81248]). It may therefore be executed in parallel from multiple threads without manual synchronization. For integrators and developers, it is furthermore relevant that the requirement in release R25-11 is provided with the status DRAFT (SWS StateManagement §8.1.3.2.2.2 “Name”).

This usage note was generated by an AI based on the AUTOSAR Adaptive Release R25-11 specification.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopeclass ara::sm::SmErrorDomain
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
const char *"Sm".

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

Record
AUTOSAR/AP/record/SWS_SM_81248
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81248@rel:R25-11#58b77bc8
Content hash
58b77bc8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81248
Status: valid/unmigrated Version: rel:R25-11#58b77bc8 Versionshistorie & Revisions (1 transition)
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_SM_81248@rel:R25-11#58b77bc8
Point-in-Time History:
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

function SmErrorDomain [SWS_SM_81247] Upstream: RS_AP_00119, RS_AP_00159

SmErrorDomain () noexcept;

Creates a SmErrorDomain instance.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: bf3f9f38c25e Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The default constructor SmErrorDomain() synchronously creates an instance of the error domain ara::sm::SmErrorDomain ([SWS_SM_81247]). The declaration is located in the header file ara/sm/sm_error_domain.h. The call requires no parameters and directly returns the initialized domain object (SWS StateManagement §8.1.3.2.1.1 “Default Constructor”).

Error handling

The function is provided with the identifier noexcept and classified as exception safe ([SWS_SM_81247]). During creation, no error codes occur and no exceptions are thrown.

Concurrency and Limitations

Creation is specified as thread-safe ([SWS_SM_81247]). Instances can therefore be created concurrently in multithreaded environments without requiring additional synchronization mechanisms. No special ordering constraints exist.

Interaction

The created object belongs to class ara::sm::SmErrorDomain ([SWS_SM_81241]), which is specified according to [SWS_CORE_90023]. Within the State Management module, the error domain interacts with the following elements:

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

Implementer's Guide to follow (complexity I2)

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopeclass ara::sm::SmErrorDomain
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

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

Record
AUTOSAR/AP/record/SWS_SM_81247
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81247@rel:R25-11#418308da
Content hash
418308da
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81247
Status: valid/unmigrated Version: rel:R25-11#418308da Versionshistorie & Revisions (1 transition)
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_SM_81247@rel:R25-11#418308da
Point-in-Time History:
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

function ThrowAsException [SWS_SM_81250] Upstream: RS_AP_00119

void ThrowAsException (const ara::core::ErrorCode &errorCode) const 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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 6b483495310f Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function ara::sm::SmErrorDomain::ThrowAsException serves to throw an error code from the State Management error domain directly as a C++ exception [SWS_SM_81250]. It is declared in the header file ara/sm/sm_error_domain.h and overrides the corresponding base function for error domains (SWS StateManagement §8.1.3.2.2.3 “ThrowAsException”).

Call and Parameters

The method is called synchronously and takes a constant reference to errorCode (of type ara::core::ErrorCode) as its only input parameter [SWS_SM_81250]. It returns no return value (void), because it instantiates and throws the exception associated with the passed error code, whereby the regular control flow at the call site is aborted [SWS_SM_81250].

Concurrency and Constraints

  • Thread safety: The function is explicitly specified as thread-safe (thread-safe) and can therefore be called from concurrent threads without issue [SWS_SM_81250].
  • Exception safety: The behavior is documented as not exception safe [SWS_SM_81250]; Interpretation: This is likely due to the fact that throwing the exception leaves the regular control flow and the method by definition fails or propagates an exception. Question Q-5afbb1be303b657b (open)
  • Compiler restriction: According to [SWS_CORE_10304], the function does not participate in overload resolution if C++ exceptions are disabled in the compiler toolchain [SWS_SM_81250].

This usage note was created by an AI and is based on the specifications for AUTOSAR Adaptive R25-11.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopeclass ara::sm::SmErrorDomain
Exception-Sicherheitnot exception safe
Thread-Sicherheitthread-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_SM_81250
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81250@rel:R25-11#7e18a0bd
Content hash
7e18a0bd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81250
Status: valid/unmigrated Version: rel:R25-11#7e18a0bd Versionshistorie & Revisions (1 transition)
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_SM_81250@rel:R25-11#7e18a0bd
Point-in-Time History:
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

Type alias documentation

type alias Errc [SWS_SM_81245] Upstream: RS_AP_00119

using Errc = SmErrc;

Alias for the error code value enumeration.

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopeclass ara::sm::SmErrorDomain
SymbolErrc

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

Record
AUTOSAR/AP/record/SWS_SM_81245
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81245@rel:R25-11#8dd72ff7
Content hash
8dd72ff7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81245
Status: valid/unmigrated Version: rel:R25-11#8dd72ff7 Versionshistorie & Revisions (1 transition)
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_SM_81245@rel:R25-11#8dd72ff7
Point-in-Time History:
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

type alias Exception [SWS_SM_81246] Upstream: RS_AP_00119

using Exception = SmException;

Alias for the exception base class.

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopeclass ara::sm::SmErrorDomain
SymbolException

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

Record
AUTOSAR/AP/record/SWS_SM_81246
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81246@rel:R25-11#7bc7b339
Content hash
7bc7b339
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81246
Status: valid/unmigrated Version: rel:R25-11#7bc7b339 Versionshistorie & Revisions (1 transition)
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_SM_81246@rel:R25-11#7bc7b339
Point-in-Time History:
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