mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-04 01:49:05 +00:00
Changed how undefined errors work
This commit is contained in:
16
Main.cpp
16
Main.cpp
@@ -155,23 +155,19 @@ int main(int argc, char** argv)
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Catches any std errors, there should be none //
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
// Prints the std exception to the console //
|
// Prints the std exception to the console //
|
||||||
// Any errors here are problems with the code //
|
// Any errors here are problems with the code //
|
||||||
std::cout << "\nAn error occured, Please report this on the github page:\n" << e.what() << std::endl;
|
std::cout << e.what() << std::endl;
|
||||||
return -1; // -1 exit code means an unknown error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (...)
|
// Default catches any non-specified errors //
|
||||||
{
|
catch (...) {}
|
||||||
// Tells the user if an error has happened //
|
|
||||||
// Any errors here are problems with the code //
|
|
||||||
std::cout << "An unknown error occured. Please report this on the github page.\n";
|
|
||||||
return -1; // -1 exit code means an unknown error
|
|
||||||
}
|
|
||||||
|
|
||||||
// -1 means an error slipped through (IDK how, it's here just in case)
|
// Closes the log if it is open to get as much info as possible //
|
||||||
|
if (log != nullptr) { log->close(); }
|
||||||
std::cout << "An unknown error occured. Please report this on the github page.\n";
|
std::cout << "An unknown error occured. Please report this on the github page.\n";
|
||||||
return -1; // -1 exit code means an unknown error
|
return -1; // -1 exit code means an unknown error
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user