mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Use last error reporting instead of PARAMETER_OUT_OF_RANGE (#3328)
Makes the error messages much more specific to each error.
This commit is contained in:
@@ -115,10 +115,6 @@ void AnalogGyro::InitGyro() {
|
||||
std::string stackTrace = wpi::GetStackTrace(1);
|
||||
m_gyroHandle =
|
||||
HAL_InitializeAnalogGyro(m_analog->m_port, stackTrace.c_str(), &status);
|
||||
if (status == PARAMETER_OUT_OF_RANGE) {
|
||||
throw FRC_MakeError(err::ParameterOutOfRange,
|
||||
"channel must be accumulator channel");
|
||||
}
|
||||
FRC_CheckErrorStatus(status, "InitializeAnalogGyro");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user