Fixes a bug with ErrorBase where the correct error code would not be set when using wpi_setWPIErrorWithContext()

Change-Id: I6ed75428d31df219daf55969e9cd019bf9e0e117
This commit is contained in:
Jonathan Leitschuh
2014-07-21 11:21:36 -04:00
parent 3d740a9a25
commit 8fe606a4b1
3 changed files with 8 additions and 6 deletions

View File

@@ -145,14 +145,14 @@ void ErrorBase::SetError(Error::Code code, const char *contextMessage,
* @param function Function of the error source
* @param lineNumber Line number of the error source
*/
void ErrorBase::SetWPIError(const char *errorMessage, const char *contextMessage,
void ErrorBase::SetWPIError(const char *errorMessage, Error::Code code , const char *contextMessage,
const char* filename, const char* function, uint32_t lineNumber) const
{
char err[256];
sprintf(err, "%s: %s", errorMessage, contextMessage);
// Set the current error information for this object.
m_error.Set(-1, err, filename, function, lineNumber, this);
m_error.Set(code, err, filename, function, lineNumber, this);
// Update the global error if there is not one already set.
Synchronized mutex(_globalErrorMutex);