MCPcopy Create free account
hub / github.com/DFHack/dfhack / fatal

Method fatal

library/Core.cpp:1059–1085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057};
1058
1059void Core::fatal (std::string output, const char * title)
1060{
1061 errorstate = true;
1062 std::stringstream out;
1063 out << output ;
1064 if (output[output.size() - 1] != '\n')
1065 out << '\n';
1066 out << "DFHack will now deactivate.\n";
1067 if(con.isInited())
1068 {
1069 con.printerr("{}", out.str());
1070 con.reset_color();
1071 con.print("\n");
1072 }
1073 fmt::print(stderr, "{}\n", out.str());
1074 out << "Check file stderr.log for details.\n";
1075 std::cout << "DFHack fatal error: " << out.str() << std::endl;
1076 if (!title)
1077 title = "DFHack error!";
1078 DFSDL::DFSDL_ShowSimpleMessageBox(0x10 /* SDL_MESSAGEBOX_ERROR */, title, out.str().c_str(), nullptr);
1079
1080 bool is_headless = bool(getenv("DFHACK_HEADLESS"));
1081 if (is_headless)
1082 {
1083 exit('f');
1084 }
1085}
1086
1087std::filesystem::path Core::getHackPath()
1088{

Callers

nothing calls this directly

Calls 6

c_strMethod · 0.80
printFunction · 0.50
sizeMethod · 0.45
strMethod · 0.45
reset_colorMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected