From 9f05d4294535727171b7011c18ea0abf9528166d Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Mon, 21 Apr 2025 15:00:09 +0100 Subject: [PATCH] Changed how undefined errors work --- Main.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Main.cpp b/Main.cpp index 786b6d4..4f88176 100644 --- a/Main.cpp +++ b/Main.cpp @@ -155,23 +155,19 @@ int main(int argc, char** argv) return 5; } + // Catches any std errors, there should be none // catch (std::exception& e) { // Prints the std exception to the console // // 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; - return -1; // -1 exit code means an unknown error + std::cout << e.what() << std::endl; } - 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 - } + // Default catches any non-specified errors // + catch (...) {} - // -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"; return -1; // -1 exit code means an unknown error }