Manages error codes of cluster ara::core, translates them into error messages, and throws corresponding exceptions.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 8500dff6850eProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Manages error codes of cluster ara::core, translates them into error messages, and throws corresponding exceptions.
The class ara::core::CoreErrorDomain represents the error domain for errors from functional cluster ara::core and maps numeric error codes to descriptive text messages [SWS_CORE_05243]. In addition, via ThrowAsException(), it enables the conversion of error codes into type-specific CoreException exceptions [SWS_CORE_05244]. Since all querying methods are thread-safe and constexpr-constructible, the domain is suitable for efficient cluster-wide use. If C++ exceptions are disabled in the toolchain, the exception method does not participate in overload resolution.
Context
The class ara::core::CoreErrorDomain represents the specific error domain for all error conditions that originate in functional cluster ara::core. It is defined as a final specialization of ErrorDomain, thereby preventing further derivation. Via method Name(), the class provides the unique short name of the domain [SWS_CORE_05242]. For consistent integration into the AUTOSAR error handling model, CoreErrorDomain defines central type aliases: as an alias, Errc directly refers to enumeration CoreErrc[SWS_CORE_05231], whereas Exception forms the alias for the associated base exception class CoreException[SWS_CORE_05232]. Key interaction partners include the generic error capsules of type ErrorCode, which hold a reference to the respective error domain, as well as executing components that diagnose or handle error conditions.
Lifecycle
The creation of a CoreErrorDomain is performed via the parameterless default constructor constexpr CoreErrorDomain() noexcept[SWS_CORE_05241]. Since the constructor is declared as constexpr and noexcept, the instance can already be created at compile time without allocation overhead or exception risk.
Interpretation: Since error domains in the AUTOSAR Adaptive standard are designed to be stateless and exclusively provide constant metadata as well as transformation logic, a global or static singleton instance that is accessed cluster-wide is likely to exist in the system. Question Q-7b4761bf124c5755 (open) The instance remains valid throughout the entire lifetime of the process. With respect to concurrency, the operations of the class are specified as thread-safe [SWS_CORE_05241], [SWS_CORE_05242], [SWS_CORE_05243], which permits concurrent queries from multiple parallel threads without additional synchronization measures.
Usage Path
During operation, CoreErrorDomain is primarily consulted by the runtime system or application code in two typical scenarios: for textual error inspection and for exception handling.
If an error has occurred, the associated text message can be queried via the member function Message() by passing the numeric error code [SWS_CORE_05243]. The specification bindingly ensures that this function never returns a null pointer (nullptr), so that the returned const char* can be safely used for diagnostic output or logging. If an error is not to be handled as a return value but propagated as a C++ exception, method ThrowAsException() serves this purpose [SWS_CORE_05244]. It accepts an instance of ErrorCode, instantiates the corresponding CoreException, and throws it into the current call stack.
Sequence diagram: Typical sequence for the translation of error codes and conditional triggering of exceptions. Sources: [SWS_CORE_05243], [SWS_CORE_05244]
Error Scenarios
Functions Name() and Message() as well as the constructor are declared as noexcept and classified as exception-safe [SWS_CORE_05241], [SWS_CORE_05242], [SWS_CORE_05243]. Even under error conditions, they do not throw exceptions and do not generate their own error codes.
In contrast, ThrowAsException() is explicitly annotated with noexcept(false) and marked as not exception-safe, since deterministically throwing an exception (of type CoreException) represents the primary task of this interface [SWS_CORE_05244]. A key architectural precondition applies: If C++ exceptions are disabled in the used toolchain or compiler settings, this function must not participate in overload resolution [SWS_CORE_05244]. This prevents compilation errors in system environments that follow the fault-tolerant embedded approach without C++ exception handling.
This guide was generated by an AI system based on specification R25-11.
Throw the exception type corresponding to the given ErrorCode.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c5a4846a6615Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The member function ThrowAsException of class ara::core::CoreErrorDomain (defined in header ara/core/core_error_domain.h) serves to synchronously trigger a C++ exception based on a passed error code [SWS_CORE_05244]. As parameter, the function accepts a reference to a const instance of ErrorCode (const ErrorCode &errorCode) [SWS_CORE_05244]. The method has no return value, but directly throws an exception of type CoreException, which completely encapsulates the passed ErrorCode object [SWS_CORE_05244].
Regarding execution context, concurrency, and compiler conditions, the following requirements apply:
Thread safety: The function is specified as thread-safe (thread-safe) and can therefore be safely called from concurrent contexts [SWS_CORE_05244].
Exception safety: The behavior is formally classified as not exception safe (not exception safe), because the function is declared with noexcept(false) and throws an exception as intended [SWS_CORE_05244].
Compiler restriction: If C++ exceptions are disabled in the compiler toolchain, the method must not participate in overload resolution according to [SWS_CORE_10304][SWS_CORE_05244].
In the architectural structure, the method overrides (override) the pure virtual base function ThrowAsException of the abstract class ara::core::ErrorDomain[SWS_CORE_00154]. In typical usage, the function is not called directly on the domain object, but is initiated via helper method ErrorCode::ThrowAsException(), which dynamically forwards the call via this->Domain().ThrowAsException(*this) to the responsible error domain [SWS_CORE_00519].
This usage note was generated by an AI based on the specification AUTOSAR Adaptive R25-11.
CoreException an exception containing the given ErrorCode
Hinweise: This function shall not participate in overload resolution when C++ exceptions are disabled in the compiler toolchain. As per [SWS_CORE_10304]
Request a governed re-review of this record. The record is not changed immediately.
gemini-3.8-flash-low· 2026-10-13 · German original