We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e85f3c commit d27ac2dCopy full SHA for d27ac2d
wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
@@ -382,8 +382,11 @@ private static <T extends RobotBase> void runRobot(Supplier<T> robotSupplier) {
382
}
383
String robotName = "Unknown";
384
StackTraceElement[] elements = throwable.getStackTrace();
385
- if (elements.length > 0) {
386
- robotName = elements[0].getClassName();
+ for (var element : elements) {
+ if (RobotBase.class.isAssignableFrom(Class.forName(element.getClassName()))) {
387
+ robotName = element.getClassName();
388
+ break;
389
+ }
390
391
DriverStation.reportError(
392
"Unhandled exception instantiating robot " + robotName + " " + throwable, elements);
0 commit comments