1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 17:35:56 +00:00

return result codes if DB connection or --debug-feed fails

This commit is contained in:
Andrew Dolgov
2017-04-25 13:39:01 +03:00
parent edb56571f2
commit 3c11159776
4 changed files with 13 additions and 5 deletions

View File

@@ -23,12 +23,16 @@ class Db implements IDb {
}
}
if (!$this->adapter) die("Error initializing database adapter for " . DB_TYPE);
if (!$this->adapter) {
print("Error initializing database adapter for " . DB_TYPE);
exit(100);
}
$this->link = $this->adapter->connect(DB_HOST, DB_USER, DB_PASS, DB_NAME, defined('DB_PORT') ? DB_PORT : "");
if (!$this->link) {
die("Error connecting through adapter: " . $this->adapter->last_error());
print("Error connecting through adapter: " . $this->adapter->last_error());
exit(101);
}
error_reporting($er);