Errors & Result Types

UMAA SDK exception and result types.

exception rtiumaapy.errors.CommandHookError(reason_enum: int = 0, message: str = '')[source]

Bases: Exception

Raised by provider hook authors to signal a command failure.

The framework catches this, validates the reason is legal for the current state (D12), and publishes FAILED status.

reason_enum

ICD CommandStatusReasonEnum value describing the failure category (e.g. VALIDATION_FAILED).

message

Human-readable description for logging / diagnostics.

exception rtiumaapy.errors.CommandFailedError(session_id: str = '', status: str = '', reason_enum: int = 0, message: str = '')[source]

Bases: Exception

Raised on the consumer side when a FAILED status is received.

Carries the full context from the DDS CommandStatusType sample.

session_id

The command session GUID string.

status

Terminal status value (e.g. FAILED).

reason_enum

ICD CommandStatusReasonEnum from the provider.

message

Human-readable reason from the provider.

exception rtiumaapy.errors.AssemblyError(root_type: str = '', slot_name: str = '', message: str = '')[source]

Bases: Exception

Raised when multi-topic element assembly fails.

root_type

Name of the root DDS type being assembled.

slot_name

Name of the element slot that failed.

class rtiumaapy.errors.CommandResult(session_id: str = '', status: str = '', data: Any = None)[source]

Bases: object

Returned by CommandConsumerSession.run() on successful completion.

session_id

The command session UUID string.

Type:

str

status

Final status string (e.g. "COMPLETED", "CANCELED").

Type:

str

data

Optional provider-supplied result data.

Type:

Any

Exception Hierarchy

Exception
├── CommandHookError      ← Provider-side: raised in hooks to signal failure
├── CommandFailedError    ← Consumer-side: raised when FAILED status received
└── AssemblyError         ← Multi-topic assembly failure (Tier 2-4, future)

CommandHookError

Raise this from any CommandProvider hook to transition the command to FAILED:

from rtiumaapy import CommandHookError
from rtiumaapy.command_provider_session import CommandReasonEnum

async def on_executing(self, session):
    if not self.hardware_ready:
        raise CommandHookError(
            reason_enum=CommandReasonEnum.RESOURCE_FAILED,
            message="Sensor hardware not responding",
        )

The framework validates the reason against the ICD’s per-state allowed failure reasons and publishes the FAILED status automatically.

CommandFailedError

Raised on the consumer side when a FAILED status is received (if using the synchronous send_and_await pattern):

from rtiumaapy import CommandFailedError

try:
    result = await consumer.send_and_await(cmd)
except CommandFailedError as e:
    print(f"Command failed: {e.reason_enum}{e.message}")

CommandResult

Returned by consumer-side operations on successful completion. Documented above with the module members.