[hal] Add HAL_GetLastError to enable better error messages from HAL calls (#3320)

This uses thread local storage so a full error string can be provided, not just an error code.
This commit is contained in:
Thad House
2021-04-29 09:56:54 -07:00
committed by GitHub
parent ced654880c
commit 5127380727
10 changed files with 81 additions and 13 deletions

View File

@@ -45,7 +45,7 @@ class RuntimeError : public std::runtime_error {
/**
* Gets error message string for an error code.
*/
const char* GetErrorMessage(int32_t code);
const char* GetErrorMessage(int32_t* code);
/**
* Reports an error to the driver station (using HAL_SendError).