Serves to report and encapsulate Time Synchronization errors in the form of an exception with an associated error code.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 02ba32fb22ccProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Serves to report and encapsulate Time Synchronization errors in the form of an exception with an associated error code.
The exception class ara::tsync::TsyncException is used to encapsulate and forward errors that occur during Time Synchronization within the Adaptive Platform. It derives from ara::core::Exception and obligatorily takes a specific ara::core::ErrorCode upon its construction that describes the cause of the error [SWS_TS_00903]. The constructor is declared as noexcept, ensuring that instantiation of the exception is guaranteed to be exception-safe and thread-safe [SWS_TS_00903]. Applications are expected to catch the exception in their error handling paths to evaluate the contained error code specifically. Question (open)
Context
The class ara::tsync::TsyncException represents the dedicated exception class for the Time Synchronization (tsync) functional area within the AUTOSAR Adaptive Platform. According to the specification, it is declared in the header ara/tsync/tsync_error_domain.h and serves as the central type to represent exceptions triggered by Time Synchronization [SWS_TS_00903]. By publicly deriving from the base class ara::core::Exception, it integrates seamlessly into the platform-wide error handling architecture.
In the system architecture, ara::tsync::TsyncException takes on the role of an information carrier between the implementation components of the Time Synchronization service and the application modules. If a severe error occurs during synchronization, it is not discarded in isolation, but reported in the form of a standardized exception. The class works closely with ara::core::ErrorCode, which encodes and encapsulates the specific cause of the error [SWS_TS_00903].
Context diagram: Classification of ara::tsync::TsyncException in interaction with Time Synchronization, ara::core::ErrorCode, and ara::core::Exception. Sources: [SWS_TS_00903]
Lifecycle
The lifecycle of an instance of ara::tsync::TsyncException begins with its explicit instantiation. The specification provides a constructor for this purpose that accepts exactly one error code of type ara::core::ErrorCode: explicit TsyncException(ara::core::ErrorCode errorCode) noexcept[SWS_TS_00903]. The declaration as explicit prevents error codes from being converted into exception objects implicitly and unintentionally.
AUTOSAR formulates strict assurances for object creation: construction is explicitly specified as exception-safe (exception safe) and thread-safe (thread-safe) [SWS_TS_00903]. The keyword noexcept guarantees that the constructor itself throws no further exception under any circumstances [SWS_TS_00903]. This is essential, as exception creation typically takes place in the error handling path and a failure at this point would lead to an uncontrolled system state.
After creation, the object is subject to standard C++ exception semantics: it is transported along the call stack until caught by a corresponding handler. Upon leaving the catch block, the lifetime of the exception instance ends and the resources are released deterministically.
Usage Path
The typical sequence when using ara::tsync::TsyncException is divided into error identification, object creation, and application-side catching:
Error identification: Time Synchronization detects a deviation or an error state at runtime and generates a matching ara::core::ErrorCode[SWS_TS_00903].
Exception creation and throwing: Using the constructor, an ara::tsync::TsyncException object is instantiated with the determined error code and thrown [SWS_TS_00903].
Error catching: The calling component catches the exception in a structured exception handling block.
Developers are expected to handle the exception in their applications either specifically as const ara::tsync::TsyncException& or catch it polymorphically via the base class const ara::core::Exception&[SWS_TS_00903]. Question Q-0c8129359ef114e8 (open) Access to the type definition requires including the header ara/tsync/tsync_error_domain.h[SWS_TS_00903].
Error Scenarios
As an exception class, ara::tsync::TsyncException serves to explicitly represent error scenarios. The central component here is the encapsulated ara::core::ErrorCode, which provides detailed information about the specific error reason within the error domain [SWS_TS_00903].
A key characteristic is the absence of a parameterless default constructor. This ensures that no exception instance can exist without an associated error code [SWS_TS_00903]. The noexcept guarantee of the constructor further ensures that the encapsulation and signaling of the error is not superseded by secondary exception errors [SWS_TS_00903].
This guide was generated by an AI based on the AUTOSAR specification R25-11.
UML class diagram
Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.
gemini-3.8-flash-low· 2026-10-13 · German original