mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 18:36:43 +00:00
Show fatal exceptions in a message box instead of cerr when running without a terminal
This commit is contained in:
parent
afa71bb622
commit
845bc5f7eb
1 changed files with 7 additions and 1 deletions
|
@ -1,7 +1,9 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
#include <components/files/configurationmanager.hpp>
|
#include <components/files/configurationmanager.hpp>
|
||||||
|
|
||||||
|
#include <SDL_messagebox.h>
|
||||||
#include <SDL_main.h>
|
#include <SDL_main.h>
|
||||||
#include "engine.hpp"
|
#include "engine.hpp"
|
||||||
|
|
||||||
|
@ -280,7 +282,11 @@ int main(int argc, char**argv)
|
||||||
}
|
}
|
||||||
catch (std::exception &e)
|
catch (std::exception &e)
|
||||||
{
|
{
|
||||||
std::cout << "\nERROR: " << e.what() << std::endl;
|
if (isatty(fileno(stdin)))
|
||||||
|
std::cerr << "\nERROR: " << e.what() << std::endl;
|
||||||
|
else
|
||||||
|
SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), NULL);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue