mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user