mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user