Merge pull request #62555 from akien-mga/error-fallback-to-fprintf
This commit is contained in:
commit
8c8eea9428
|
@ -83,7 +83,13 @@ void _err_print_error(const char *p_function, const char *p_file, int p_line, co
|
|||
|
||||
// Main error printing function.
|
||||
void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, const char *p_message, bool p_editor_notify, ErrorHandlerType p_type) {
|
||||
OS::get_singleton()->print_error(p_function, p_file, p_line, p_error, p_message, p_editor_notify, (Logger::ErrorType)p_type);
|
||||
if (OS::get_singleton()) {
|
||||
OS::get_singleton()->print_error(p_function, p_file, p_line, p_error, p_message, p_editor_notify, (Logger::ErrorType)p_type);
|
||||
} else {
|
||||
// Fallback if errors happen before OS init or after it's destroyed.
|
||||
const char *err_details = (p_message && *p_message) ? p_message : p_error;
|
||||
fprintf(stderr, "ERROR: %s\n at: %s (%s:%i)\n", err_details, p_function, p_file, p_line);
|
||||
}
|
||||
|
||||
_global_lock();
|
||||
ErrorHandlerList *l = error_handler_list;
|
||||
|
|
Loading…
Reference in New Issue