[wpilibj] Clarify robot quit message (#3364)

Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
This commit is contained in:
Ryan Hirasaki
2021-06-16 15:24:06 -05:00
committed by GitHub
parent 791770cf6e
commit 49c71f9f2d

View File

@@ -300,7 +300,12 @@ public abstract class RobotBase implements AutoCloseable {
DriverStation.reportError(
"Unhandled exception instantiating robot " + robotName + " " + throwable.toString(),
elements);
DriverStation.reportWarning("Robots should not quit, but yours did!", false);
DriverStation.reportWarning(
"The robot program quit unexpectedly."
+ " This is usually due to a code error.\n"
+ " The above stacktrace can help determine where the error occurred.\n"
+ " See https://wpilib.org/stacktrace for more information.\n",
false);
DriverStation.reportError("Could not instantiate robot " + robotName + "!", false);
return;
}
@@ -347,7 +352,12 @@ public abstract class RobotBase implements AutoCloseable {
m_runMutex.unlock();
if (!suppressExitWarning) {
// startCompetition never returns unless exception occurs....
DriverStation.reportWarning("Robots should not quit, but yours did!", false);
DriverStation.reportWarning(
"The robot program quit unexpectedly."
+ " This is usually due to a code error.\n"
+ " The above stacktrace can help determine where the error occurred.\n"
+ " See https://wpilib.org/stacktrace for more information.",
false);
if (errorOnExit) {
DriverStation.reportError(
"The startCompetition() method (or methods called by it) should have "
@@ -361,7 +371,7 @@ public abstract class RobotBase implements AutoCloseable {
}
/**
* Suppress the "Robots should not quit" message.
* Suppress the "The robot program quit unexpectedly." message.
*
* @param value True if exit warning should be suppressed.
*/