Function rcutils_get_error_string

Function Documentation

rcutils_error_string_t rcutils_get_error_string(void)

Return the error message followed by , at <file>:<line> if set, else “error not set”.

This function is “safe” because it returns a copy of the current error string or one containing the string “error not set” if no error was set. This ensures that the copy is owned by the calling thread and is therefore never invalidated by other error handling calls, and that the C string inside is always valid and null terminated.

Returns:

The current error string, with file and line number, or “error not set” if not set.