mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Prevent StopMotor from terminating robot during MotorSafety check (#4038)
- Nothing else in that function can throw, so protecting StopMotor should be sufficient - Fixes #4036
This commit is contained in:
@@ -98,7 +98,15 @@ void MotorSafety::Check() {
|
||||
if (stopTime < Timer::GetFPGATimestamp()) {
|
||||
FRC_ReportError(err::Timeout, "{}... Output not updated often enough",
|
||||
GetDescription());
|
||||
StopMotor();
|
||||
|
||||
try {
|
||||
StopMotor();
|
||||
} catch (frc::RuntimeError& e) {
|
||||
e.Report();
|
||||
} catch (std::exception& e) {
|
||||
FRC_ReportError(err::Error, "{} StopMotor threw unexpected exception: {}",
|
||||
GetDescription(), e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user