For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exceptions

Namespace: yams::exceptions Header: #include <yams/exceptions.hpp> Java equivalent: Java Exceptions Doxygen: yams::exceptions

All YAMS C++ exceptions extend yams::exceptions::YamsException, which extends std::runtime_error.


Base exception

class YamsException : public std::runtime_error {
public:
    explicit YamsException(const std::string& message);
};

Exception classes

Class
Thrown When

ArmConfigurationException

Required ArmConfig fields are missing or invalid

ElevatorConfigurationException

Required ElevatorConfig fields are missing or invalid

PivotConfigurationException

Required PivotConfig fields are missing or invalid

SwerveDriveConfigurationException

Required swerve drive config fields are missing or invalid

SmartMotorControllerConfigurationException

SmartMotorControllerConfig is invalid

NoStagesGivenException

GearBox or Sprocket constructed with an empty stage list

InvalidStageGivenException

A stage string is not in "IN:OUT" format


Constructor patterns

Configuration exceptions

Most configuration exceptions follow this three-argument pattern:

Parameter
Description

issue

Description of the invalid or missing configuration

result

The runtime consequence of the misconfiguration

fix

Suggested corrective action

SwerveDriveConfigurationException

Takes a single message string rather than the three-argument pattern.

Gearing exceptions


Example

All YAMS exceptions are unchecked (derived from std::runtime_error). They are thrown eagerly at mechanism construction time when required config fields are absent, not deferred to the first control call.

Last updated

Was this helpful?