mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 23:21:20 -04: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,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…
x
Reference in New Issue
Block a user