If the errorTest condition passes, print out message using printf, then invoke OnErrorFired() on each ErrorHandlerInterface that has been added via TurtleBrains::Core::Error::AddErrorHandler.
- Parameters
-
errorTest | An expression that will be evaluated to true/false. |
message | A printf formatted const char* const null-terminated string with information about the failure. |
... | The parameters that should be used with the printf formatted string. |
- See also
- TurtleBrains::Core::Error::ErrorIf(),
-
printf documentation
#include "turtle_brains/core/tb_error.h"
int main(int argumentCount, char* argumentValues[])
{
tb_error_if(std::string(
"Hello World") !=
"Hello World",
"Expected the Hello World strings to match!");
return 0;
}
- Note
- 2022-04-29: Using the function TriggerErrorIf() requires all parameters to be processed and passed into the function, where as performing the test then calling TriggerError() will only process and pass if the error occurred. This was discovered as OpenALErrorToString was taking enough time to be a hotspot, but there were no errors in the logs.