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

@@ -26,6 +26,12 @@
if ((code) != 0) \
this->SetError((code), (context), __FILE__, __FUNCTION__, __LINE__); \
} while (0)
#define wpi_setErrorWithContextRange(code, min, max, req, context) \
do { \
if ((code) != 0) \
this->SetErrorRange((code), (min), (max), (req), (context), __FILE__, \
__FUNCTION__, __LINE__); \
} while (0)
#define wpi_setError(code) wpi_setErrorWithContext(code, "")
#define wpi_setStaticErrorWithContext(object, code, context) \
do { \
@@ -82,6 +88,11 @@ class ErrorBase {
virtual void SetError(Error::Code code, llvm::StringRef contextMessage,
llvm::StringRef filename, llvm::StringRef function,
uint32_t lineNumber) const;
virtual void SetErrorRange(Error::Code code, int32_t minRange,
int32_t maxRange, int32_t requestedValue,
llvm::StringRef contextMessage,
llvm::StringRef filename, llvm::StringRef function,
uint32_t lineNumber) const;
virtual void SetWPIError(llvm::StringRef errorMessage, Error::Code code,
llvm::StringRef contextMessage,
llvm::StringRef filename, llvm::StringRef function,