Host: Add ReportFatalError()

This commit is contained in:
Stenzek
2024-02-25 18:19:54 +10:00
parent 18ba2032ad
commit 9ac9fc0a1e
4 changed files with 46 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "nogui_host.h"
@@ -327,6 +327,12 @@ void NoGUIHost::SetDefaultSettings(SettingsInterface& si, bool system, bool cont
g_nogui_window->SetDefaultConfig(si);
}
void Host::ReportFatalError(const std::string_view& title, const std::string_view& message)
{
Log_ErrorPrintf("ReportFatalError: %.*s", static_cast<int>(message.size()), message.data());
abort();
}
void Host::ReportErrorAsync(const std::string_view& title, const std::string_view& message)
{
if (!title.empty() && !message.empty())