improve SDL error reporting

This commit is contained in:
Ondrej Novak 2025-05-01 19:36:11 +02:00
parent 93ec526482
commit 46c85d8f30
2 changed files with 3 additions and 2 deletions

View file

@ -74,7 +74,7 @@ SDLContext::SDLContext() {
void handle_sdl_error(const char *msg) {
char buff[512];
snprintf(buff, sizeof(buff), "SDL critical error (check video driver): %s %s",msg, SDL_GetError());
snprintf(buff, sizeof(buff), "SDL critical error: %s %s",msg, SDL_GetError());
throw std::runtime_error(buff);
}

View file

@ -1,6 +1,7 @@
#include "../../game/skeldal.h"
#include "../getopt.h"
#include "../platform.h"
#include "../error.h"
#include <iostream>
#include <string>
#include <sstream>
@ -82,7 +83,7 @@ int main(int argc, char **argv) {
}
} catch (const std::exception &e) {
cfg.show_error(e.what());
cfg.show_error(exception_to_string(e).c_str());
return 1;
}
catch (...) {