Merge branch 'wpilib-SetGlobalError' into network-robot-new
diff --git a/aos/externals/WPILib/WPILib/ErrorBase.cpp b/aos/externals/WPILib/WPILib/ErrorBase.cpp
index d651f9a..5f766c7 100644
--- a/aos/externals/WPILib/WPILib/ErrorBase.cpp
+++ b/aos/externals/WPILib/WPILib/ErrorBase.cpp
@@ -166,6 +166,7 @@
/**
* @brief Set the current global error information.
* Does nothing if code is 0.
+ * TODO: think about getting rid of this because nothing uses it any more
*
* @param code The error code
* @param contextMessage A custom message from the code that set the error.
@@ -176,8 +177,10 @@
void ErrorBase::SetGlobalError(Error::Code code, const char *contextMessage,
const char* filename, const char* function, UINT32 lineNumber)
{
- // Set the current error information for this object.
- _globalError.Set(code, contextMessage, filename, function, lineNumber, NULL);
+ if (code != 0) {
+ // Set the current error information for this object.
+ _globalError.Set(code, contextMessage, filename, function, lineNumber, NULL);
+ }
}
/**