mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Implements Better Error Messages from the HAL (#172)
* Makes the HAL provide a better error message for certain things. * Makes Java error messages better * Updates C++ errors. * Moves handles header folder to HAL directory
This commit is contained in:
committed by
Peter Johnson
parent
05c00430b3
commit
d2aa168f66
@@ -38,7 +38,8 @@ Relay::Relay(uint32_t channel, Relay::Direction direction)
|
||||
int32_t status = 0;
|
||||
m_forwardHandle = HAL_InitializeRelayPort(portHandle, true, &status);
|
||||
if (status != 0) {
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
wpi_setErrorWithContextRange(status, 0, HAL_GetNumRelayPins(), channel,
|
||||
HAL_GetErrorMessage(status));
|
||||
m_forwardHandle = HAL_kInvalidHandle;
|
||||
m_reverseHandle = HAL_kInvalidHandle;
|
||||
return;
|
||||
@@ -49,7 +50,8 @@ Relay::Relay(uint32_t channel, Relay::Direction direction)
|
||||
int32_t status = 0;
|
||||
m_reverseHandle = HAL_InitializeRelayPort(portHandle, false, &status);
|
||||
if (status != 0) {
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
wpi_setErrorWithContextRange(status, 0, HAL_GetNumRelayPins(), channel,
|
||||
HAL_GetErrorMessage(status));
|
||||
m_forwardHandle = HAL_kInvalidHandle;
|
||||
m_reverseHandle = HAL_kInvalidHandle;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user