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:
Thad House
2016-07-13 20:29:28 -07:00
committed by Peter Johnson
parent 05c00430b3
commit d2aa168f66
51 changed files with 175 additions and 70 deletions

View File

@@ -44,7 +44,8 @@ Solenoid::Solenoid(uint8_t moduleNumber, uint32_t channel)
m_solenoidHandle = HAL_InitializeSolenoidPort(
HAL_GetPortWithModule(moduleNumber, channel), &status);
if (status != 0) {
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
wpi_setErrorWithContextRange(status, 0, HAL_GetNumSolenoidPins(), channel,
HAL_GetErrorMessage(status));
m_solenoidHandle = HAL_kInvalidHandle;
return;
}