mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilibj] Crash robot program if an exception occurs during opmode construction (#8982)
There's essentially nothing the user can do here, other then switch opmodes. It will make it clearer that something is very wrong.
This commit is contained in:
@@ -118,9 +118,8 @@ public abstract class OpModeRobot extends RobotBase {
|
||||
try {
|
||||
return constructor.get().newInstance(this);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
DriverStationErrors.reportError(
|
||||
"Could not instantiate OpMode " + cls.getSimpleName(), e.getStackTrace());
|
||||
return null;
|
||||
throw new RuntimeException(
|
||||
"Could not instantiate OpMode " + cls.getSimpleName(), e.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user