[wpilibc] Remove ErrorBase (#3306)

Replace with new exception-based error reporting, consistent with Java.
This also builds stacktraces into the reporting/exceptions.
This commit is contained in:
Peter Johnson
2021-04-18 20:35:29 -07:00
committed by GitHub
parent 0abf6c9045
commit 8d961dfd25
113 changed files with 993 additions and 2200 deletions

View File

@@ -14,6 +14,7 @@
#include <wpi/raw_ostream.h>
#include "frc/Base.h"
#include "frc/Errors.h"
namespace frc {
@@ -25,12 +26,17 @@ namespace impl {
template <class Robot>
void RunRobot(wpi::mutex& m, Robot** robot) {
static Robot theRobot;
{
std::scoped_lock lock{m};
*robot = &theRobot;
try {
static Robot theRobot;
{
std::scoped_lock lock{m};
*robot = &theRobot;
}
theRobot.StartCompetition();
} catch (const frc::RuntimeError& e) {
e.Report();
throw;
}
theRobot.StartCompetition();
}
} // namespace impl