Logs: Flush unreported errors when turning off Stack Cell errors (#12366)

This commit is contained in:
Elad Ashkenazi 2022-07-19 18:05:51 +03:00 committed by GitHub
parent 5e11b2b056
commit 31df99f7d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -2566,13 +2566,6 @@ s32 error_code::error_report(s32 result, const char* fmt, const fmt_type_info* s
if (!fmt)
{
// Report and clean error state
if (g_log_all_errors) [[unlikely]]
{
g_tls_error_stats.clear();
return 0;
}
for (auto&& pair : g_tls_error_stats)
{
if (pair.second > 3)
@ -2613,6 +2606,12 @@ s32 error_code::error_report(s32 result, const char* fmt, const fmt_type_info* s
if (g_log_all_errors) [[unlikely]]
{
if (!g_tls_error_stats.empty())
{
// Report and clean error state
error_report(0, nullptr, nullptr, nullptr);
}
channel->error("%s", g_tls_error_str);
}
else