mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
update exception catching (#1661)
This commit is contained in:
@@ -103,7 +103,7 @@ int main(int argc, char** argv) {
|
||||
//Connect to the MySQL Database
|
||||
try {
|
||||
Database::Connect();
|
||||
} catch (sql::SQLException& ex) {
|
||||
} catch (std::exception& ex) {
|
||||
LOG("Got an error while connecting to the database: %s", ex.what());
|
||||
LOG("Migrations not run");
|
||||
return EXIT_FAILURE;
|
||||
@@ -264,7 +264,7 @@ int main(int argc, char** argv) {
|
||||
//Create account
|
||||
try {
|
||||
Database::Get()->InsertNewAccount(username, std::string(hash, BCRYPT_HASHSIZE));
|
||||
} catch (sql::SQLException& e) {
|
||||
} catch (std::exception& e) {
|
||||
LOG("A SQL error occurred!:\n %s", e.what());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
@@ -24,9 +24,9 @@ void PersistentIDManager::Initialize() {
|
||||
LOG("Invalid persistent object ID in database. Aborting to prevent bad id generation.");
|
||||
throw std::runtime_error("Invalid persistent object ID in database. Aborting to prevent bad id generation.");
|
||||
}
|
||||
} catch (sql::SQLException& e) {
|
||||
} catch (std::exception& e) {
|
||||
LOG("Unable to fetch max persistent object ID in use. This will cause issues. Aborting to prevent collisions.");
|
||||
LOG("SQL error: %s", e.what());
|
||||
LOG("Error: %s", e.what());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user