YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Yet Another Software Suite
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#pragma once
5
6#include <stdexcept>
7#include <string>
8
9namespace yams::exceptions {
15class YamsException : public std::runtime_error {
16 public:
22 explicit YamsException(const std::string& message) : std::runtime_error(message) {}
23};
24
29 public:
37 ArmConfigurationException(const std::string& issue, const std::string& result,
38 const std::string& fix)
40 "[Arm Configuration Error]\n"
41 "Issue: " +
42 issue + "\nResult: " + result + "\nFix: " + fix) {}
43};
44
49 public:
55 explicit SwerveDriveConfigurationException(const std::string& message)
56 : YamsException("[SwerveDrive Configuration Error]\n" + message) {}
57};
58
63 public:
71 SmartMotorControllerConfigurationException(const std::string& issue, const std::string& result,
72 const std::string& fix)
74 "[SmartMotorController Configuration Error]\n"
75 "Issue: " +
76 issue + "\nResult: " + result + "\nFix: " + fix) {}
77};
78
83 public:
91 PivotConfigurationException(const std::string& issue, const std::string& result,
92 const std::string& fix)
94 "[Pivot Configuration Error]\n"
95 "Issue: " +
96 issue + "\nResult: " + result + "\nFix: " + fix) {}
97};
98
103 public:
106 : YamsException("No reduction stages were given to the GearBox/Sprocket!") {}
107};
108
113 public:
119 explicit InvalidStageGivenException(const std::string& stage)
120 : YamsException("Invalid stage given: \"" + stage +
121 "\". Stage must be in the format of \"IN:OUT\"") {}
122};
123
128 public:
136 ElevatorConfigurationException(const std::string& issue, const std::string& result,
137 const std::string& fix)
139 "[Elevator Configuration Error]\n"
140 "Issue: " +
141 issue + "\nResult: " + result + "\nFix: " + fix) {}
142};
143
144} // namespace yams::exceptions
ArmConfigurationException(const std::string &issue, const std::string &result, const std::string &fix)
Definition exceptions.hpp:37
ElevatorConfigurationException(const std::string &issue, const std::string &result, const std::string &fix)
Definition exceptions.hpp:136
InvalidStageGivenException(const std::string &stage)
Definition exceptions.hpp:119
Definition exceptions.hpp:102
NoStagesGivenException()
Definition exceptions.hpp:105
PivotConfigurationException(const std::string &issue, const std::string &result, const std::string &fix)
Definition exceptions.hpp:91
SmartMotorControllerConfigurationException(const std::string &issue, const std::string &result, const std::string &fix)
Definition exceptions.hpp:71
SwerveDriveConfigurationException(const std::string &message)
Definition exceptions.hpp:55
Definition exceptions.hpp:15
YamsException(const std::string &message)
Definition exceptions.hpp:22
Definition exceptions.hpp:9