Skip to content

Commit

Permalink
Error handler: Print fatal exceptions to command line
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 authored Aug 15, 2024
1 parent 3e0030c commit 2d92941
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/supertux/error_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,9 @@ ErrorHandler::error_dialog_crash(const std::string& stacktrace)
void
ErrorHandler::error_dialog_exception(const std::string& exception)
{
std::stringstream stream;
char msg[] = "SuperTux has encountered a fatal exception!";

stream << "SuperTux has encountered a fatal exception!";

if (!exception.empty())
{
stream << "\n\n" << exception;
}

std::string msg = stream.str();
std::cerr << msg << "\n\n" << exception << std::endl;

SDL_MessageBoxButtonData btns[] = {
#ifdef WIN32
Expand All @@ -320,7 +313,7 @@ ErrorHandler::error_dialog_exception(const std::string& exception)
SDL_MESSAGEBOX_ERROR, // flags
nullptr, // window
"Error", // title
msg.c_str(), // message
msg, // message
SDL_arraysize(btns), // numbuttons
btns, // buttons
nullptr // colorscheme
Expand Down

0 comments on commit 2d92941

Please sign in to comment.