mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +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:
@@ -7,7 +7,7 @@
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/Threads.h>
|
||||
|
||||
#include "frc/ErrorBase.h"
|
||||
#include "frc/Errors.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -16,7 +16,7 @@ int GetThreadPriority(std::thread& thread, bool* isRealTime) {
|
||||
HAL_Bool rt = false;
|
||||
auto native = thread.native_handle();
|
||||
auto ret = HAL_GetThreadPriority(&native, &rt, &status);
|
||||
wpi_setGlobalHALError(status);
|
||||
FRC_CheckErrorStatus(status, "GetThreadPriority");
|
||||
*isRealTime = rt;
|
||||
return ret;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ int GetCurrentThreadPriority(bool* isRealTime) {
|
||||
int32_t status = 0;
|
||||
HAL_Bool rt = false;
|
||||
auto ret = HAL_GetCurrentThreadPriority(&rt, &status);
|
||||
wpi_setGlobalHALError(status);
|
||||
FRC_CheckErrorStatus(status, "GetCurrentThreadPriority");
|
||||
*isRealTime = rt;
|
||||
return ret;
|
||||
}
|
||||
@@ -34,14 +34,14 @@ bool SetThreadPriority(std::thread& thread, bool realTime, int priority) {
|
||||
int32_t status = 0;
|
||||
auto native = thread.native_handle();
|
||||
auto ret = HAL_SetThreadPriority(&native, realTime, priority, &status);
|
||||
wpi_setGlobalHALError(status);
|
||||
FRC_CheckErrorStatus(status, "SetThreadPriority");
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool SetCurrentThreadPriority(bool realTime, int priority) {
|
||||
int32_t status = 0;
|
||||
auto ret = HAL_SetCurrentThreadPriority(realTime, priority, &status);
|
||||
wpi_setGlobalHALError(status);
|
||||
FRC_CheckErrorStatus(status, "SetCurrentThreadPriority");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user