Skip to content

Commit 4ca443e

Browse files
committed
Move unknown robot error
1 parent b0fbf2b commit 4ca443e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,19 @@ private static <T extends RobotBase> void runRobot(Supplier<T> robotSupplier) {
389389
break;
390390
}
391391
} catch (ClassNotFoundException e) {
392-
DriverStation.reportError(
393-
"Could not find class from stack trace? This should not happen.\n"
394-
+ "If simulating in VS Code, try opening the Command Palette "
395-
+ "and running Clean Java Language Server Workspace.\n"
396-
+ "If this is on a real robot, try redeploying. If this is persistent, "
397-
+ "report this on https://github.com/wpilibsuite/allwpilib/issues/new?template=bug_report.md. Error: "
398-
+ throwable,
399-
elements);
392+
// This should never happen!
400393
}
401394
}
395+
if ("Unknown".equals(robotName)) {
396+
DriverStation.reportError(
397+
"Could not find class from stack trace? This should not happen.\n"
398+
+ "If simulating in VS Code, try opening the Command Palette "
399+
+ "and running Clean Java Language Server Workspace.\n"
400+
+ "If this is on a real robot, try redeploying. If this is persistent, "
401+
+ "report this on https://github.com/wpilibsuite/allwpilib/issues/new?template=bug_report.md. Error: "
402+
+ throwable,
403+
elements);
404+
}
402405
DriverStation.reportError(
403406
"Unhandled exception instantiating robot " + robotName + " " + throwable, elements);
404407
DriverStation.reportError(

0 commit comments

Comments
 (0)