mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-05 06:00:33 -04:00
improve SDL error reporting
This commit is contained in:
parent
93ec526482
commit
46c85d8f30
2 changed files with 3 additions and 2 deletions
|
@ -74,7 +74,7 @@ SDLContext::SDLContext() {
|
||||||
void handle_sdl_error(const char *msg) {
|
void handle_sdl_error(const char *msg) {
|
||||||
char buff[512];
|
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);
|
throw std::runtime_error(buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "../../game/skeldal.h"
|
#include "../../game/skeldal.h"
|
||||||
#include "../getopt.h"
|
#include "../getopt.h"
|
||||||
#include "../platform.h"
|
#include "../platform.h"
|
||||||
|
#include "../error.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -82,7 +83,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
cfg.show_error(e.what());
|
cfg.show_error(exception_to_string(e).c_str());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue