... since it's all just a test - added a try catch on db connection
This commit is contained in:
parent
03f38387e2
commit
89b80f0656
1 changed files with 7 additions and 1 deletions
|
@ -14,7 +14,13 @@ Server::Server():
|
|||
|
||||
db->setCredentials("pica", "pica");
|
||||
db->setDatabase("pica");
|
||||
|
||||
try {
|
||||
db->connect("/run/mysqld/mysqld.sock");
|
||||
std::cout << "Successfully connected to the database" << std::endl;
|
||||
} catch (const std::runtime_error& e) {
|
||||
std::cerr << "Couldn't connect to the database: " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
router.addRoute("info", Server::info);
|
||||
router.addRoute("env", Server::printEnvironment);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue